Tool: create_topic
Create a new Google Cloud Managed Service for Apache Kafka topic. Please provide the Project ID, Location, Cluster ID, and a unique Topic ID.
You must also specify:
- 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.
The following sample demonstrate how to use curl to invoke the create_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": "create_topic", "arguments": { // provide these details according to the tool's MCP specification } }, "jsonrpc": "2.0", "id": 1 }' |
Input Schema
Request for CreateTopic.
CreateTopicRequest
| JSON representation |
|---|
{
"parent": string,
"topicId": string,
"topic": {
object ( |
| Fields | |
|---|---|
parent |
Required. The parent cluster in which to create the topic. Structured like |
topicId |
Required. The ID to use for the topic, which will become the final component of the topic's name. This value is structured like: |
topic |
Required. Configuration of the topic to create. Its |
Topic
| JSON representation |
|---|
{ "name": string, "partitionCount": integer, "replicationFactor": integer, "configs": { string: string, ... } } |
| Fields | |
|---|---|
name |
Identifier. The name of the topic. The |
partitionCount |
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 |
Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability. |
configs |
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: An object containing a list of |
ConfigsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
Output Schema
A Kafka topic in a given cluster.
Topic
| JSON representation |
|---|
{ "name": string, "partitionCount": integer, "replicationFactor": integer, "configs": { string: string, ... } } |
| Fields | |
|---|---|
name |
Identifier. The name of the topic. The |
partitionCount |
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 |
Required. Immutable. The number of replicas of each partition. A replication factor of 3 is recommended for high availability. |
configs |
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: An object containing a list of |
ConfigsEntry
| JSON representation |
|---|
{ "key": string, "value": string } |
| Fields | |
|---|---|
key |
|
value |
|
Tool Annotations
Destructive Hint: ❌ | Idempotent Hint: ❌ | Read Only Hint: ❌ | Open World Hint: ❌