MCP Tools Reference: managedkafka

Tool: update_topic

Update an existing Google Cloud Managed service for Apache Kafka topic. Please provide the Project ID, Location, Cluster ID, and Topic ID.

You can update the following fields:

  • Partition Count:The number of partitions for the topic (default of 3). This can only be increased.
  • Replication Factor:The number of replicas for each partition. A replication factor of 3 is recommended for high availability.

Important Notes:

  • The UpdateTopic request requires the following parameters:
    • update_mask : A field mask used to specify the fields to be overwritten. For example, to update the partition_count and replication_factor , the mask would be "partition_count,replication_factor" . A value of * will overwrite all fields.
    • topic : The topic configuration, including the required partition_count and replication_factor .
    • topic.name : The name of the topic to be updated in the format projects/{project}/locations/{location}/clusters/{cluster}/topics/{topic} .

The following sample demonstrate how to use curl to invoke the update_topic 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_topic", 
 "arguments": { 
 // provide these details according to the tool' 
s  
MCP  
specification  
 } 
  
 } 
,  
 "jsonrpc" 
:  
 "2.0" 
,  
 "id" 
:  
 1 
 } 
 ' 
  

Input Schema

Request for UpdateTopic.

UpdateTopicRequest

JSON representation
 { 
 "updateMask" 
 : 
 string 
 , 
 "topic" 
 : 
 { 
 object (  Topic 
 
) 
 } 
 } 
Fields
updateMask

string ( FieldMask format)

Required. Field mask is used to specify the fields to be overwritten in the Topic 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" .

topic

object ( Topic )

Required. The topic to update. Its name field must be populated.

FieldMask

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

string

The set of field mask paths.

Topic

JSON representation
 { 
 "name" 
 : 
 string 
 , 
 "partitionCount" 
 : 
 integer 
 , 
 "replicationFactor" 
 : 
 integer 
 , 
 "configs" 
 : 
 { 
 string 
 : 
 string 
 , 
 ... 
 } 
 } 
Fields
name

string

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

partitionCount

integer

Required. The number of partitions this topic has. The partition count can only be increased, not decreased. Please note that if partitions are increased for a topic that has a key, the partitioning logic or the ordering of the messages will be affected.

replicationFactor

integer

Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability.

configs

map (key: string, value: string)

Optional. Configurations for the topic that are overridden from the cluster defaults. The key of the map is a Kafka topic property name, for example: cleanup.policy , compression.type .

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

ConfigsEntry

JSON representation
 { 
 "key" 
 : 
 string 
 , 
 "value" 
 : 
 string 
 } 
Fields
key

string

value

string

Output Schema

A Kafka topic in a given cluster.

Topic

JSON representation
 { 
 "name" 
 : 
 string 
 , 
 "partitionCount" 
 : 
 integer 
 , 
 "replicationFactor" 
 : 
 integer 
 , 
 "configs" 
 : 
 { 
 string 
 : 
 string 
 , 
 ... 
 } 
 } 
Fields
name

string

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

partitionCount

integer

Required. The number of partitions this topic has. The partition count can only be increased, not decreased. Please note that if partitions are increased for a topic that has a key, the partitioning logic or the ordering of the messages will be affected.

replicationFactor

integer

Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability.

configs

map (key: string, value: string)

Optional. Configurations for the topic that are overridden from the cluster defaults. The key of the map is a Kafka topic property name, for example: cleanup.policy , compression.type .

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

ConfigsEntry

JSON representation
 { 
 "key" 
 : 
 string 
 , 
 "value" 
 : 
 string 
 } 
Fields
key

string

value

string

Tool Annotations

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

Design a Mobile Site
View Site in Mobile | Classic
Share by: