MCP Tools Reference: managedkafka

Tool: update_consumer_group

Update an existing Google Cloud Managed Service for Apache Kafka consumer group. To update a consumer group, please provide the Project ID, Location, Cluster ID, and Consumer Group ID.

Important Notes:

  • To update a consumer group's offsets, the consumer group must be inactive (i.e., there are no active consumers in the group).
  • Before making an update, the agent should call get_consumer_group to retrieve the current consumer group configuration, so that it can be included in the UpdateConsumerGroupRequest.
  • The UpdateConsumerGroup request requires the following parameters:
    • update_mask: The only supported update_mask is "topics", which will be used to completely overwrite the consumer group's topics field. Make this clear to the user if they are trying to update any offsets.
    • consumer_group: The consumer group configuration. The consumer_group.name field is required.
    • consumer_group.name: The name of the consumer group to be updated in the format projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumerGroup}.

The following sample demonstrate how to use curl to invoke the update_consumer_group MCP tool.

Curl Request
                  
curl --location 'https://managedkafka.googleapis.com/mcp' \
--header 'content-type: application/json' \
--header 'accept: application/json, text/event-stream' \
--data '{
  "method": "tools/call",
  "params": {
    "name": "update_consumer_group",
    "arguments": {
      // provide these details according to the tool's MCP specification
    }
  },
  "jsonrpc": "2.0",
  "id": 1
}'
                

Input Schema

Request for UpdateConsumerGroup.

UpdateConsumerGroupRequest

JSON representation
{
  "updateMask": string,
  "consumerGroup": {
    object (ConsumerGroup)
  }
}
Fields
updateMask

string (FieldMask format)

Required. Field mask is used to specify the fields to be overwritten in the ConsumerGroup resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. The mask is required and a value of * will update all fields.

This is a comma-separated list of fully qualified names of fields. Example: "user.displayName,photo".

consumerGroup

object (ConsumerGroup)

Required. The consumer group to update. Its name field must be populated.

FieldMask

JSON representation
{
  "paths": [
    string
  ]
}
Fields
paths[]

string

The set of field mask paths.

ConsumerGroup

JSON representation
{
  "name": string,
  "topics": {
    string: {
      object (ConsumerTopicMetadata)
    },
    ...
  }
}
Fields
name

string

Identifier. The name of the consumer group. The consumer_group segment is used when connecting directly to the cluster. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumer_group}

topics

map (key: string, value: object (ConsumerTopicMetadata))

Optional. Metadata for this consumer group for all topics it has metadata for. The key of the map is a topic name, structured like: projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

TopicsEntry

JSON representation
{
  "key": string,
  "value": {
    object (ConsumerTopicMetadata)
  }
}
Fields
key

string

value

object (ConsumerTopicMetadata)

ConsumerTopicMetadata

JSON representation
{
  "partitions": {
    integer: {
      object (ConsumerPartitionMetadata)
    },
    ...
  }
}
Fields
partitions

map (key: integer, value: object (ConsumerPartitionMetadata))

Optional. Metadata for this consumer group and topic for all partition indexes it has metadata for.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

PartitionsEntry

JSON representation
{
  "key": integer,
  "value": {
    object (ConsumerPartitionMetadata)
  }
}
Fields
key

integer

value

object (ConsumerPartitionMetadata)

ConsumerPartitionMetadata

JSON representation
{
  "offset": string,
  "metadata": string
}
Fields
offset

string (int64 format)

Required. The current offset for this partition, or 0 if no offset has been committed.

metadata

string

Optional. The associated metadata for this partition, or empty if it does not exist.

Output Schema

A Kafka consumer group in a given cluster.

ConsumerGroup

JSON representation
{
  "name": string,
  "topics": {
    string: {
      object (ConsumerTopicMetadata)
    },
    ...
  }
}
Fields
name

string

Identifier. The name of the consumer group. The consumer_group segment is used when connecting directly to the cluster. Structured like: projects/{project}/locations/{location}/clusters/{cluster}/consumerGroups/{consumer_group}

topics

map (key: string, value: object (ConsumerTopicMetadata))

Optional. Metadata for this consumer group for all topics it has metadata for. The key of the map is a topic name, structured like: projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic}

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

TopicsEntry

JSON representation
{
  "key": string,
  "value": {
    object (ConsumerTopicMetadata)
  }
}
Fields
key

string

value

object (ConsumerTopicMetadata)

ConsumerTopicMetadata

JSON representation
{
  "partitions": {
    integer: {
      object (ConsumerPartitionMetadata)
    },
    ...
  }
}
Fields
partitions

map (key: integer, value: object (ConsumerPartitionMetadata))

Optional. Metadata for this consumer group and topic for all partition indexes it has metadata for.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

PartitionsEntry

JSON representation
{
  "key": integer,
  "value": {
    object (ConsumerPartitionMetadata)
  }
}
Fields
key

integer

value

object (ConsumerPartitionMetadata)

ConsumerPartitionMetadata

JSON representation
{
  "offset": string,
  "metadata": string
}
Fields
offset

string (int64 format)

Required. The current offset for this partition, or 0 if no offset has been committed.

metadata

string

Optional. The associated metadata for this partition, or empty if it does not exist.

Tool Annotations

Destructive Hint: ✅ | Idempotent Hint: ✅ | Read Only Hint: ❌ | Open World Hint: ❌