MCP Tools Reference: managedkafka

Tool: list_topics

List all topics for Google Cloud Managed Service for Apache Kafka for a given project, location, and cluster. Please provide the Project ID, Location, and Cluster ID.

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

Input Schema

Request for ListTopics.

ListTopicsRequest

JSON representation
{
  "parent": string,
  "pageSize": integer,
  "pageToken": string
}
Fields
parent

string

Required. The parent cluster whose topics are to be listed. Structured like projects/{project}/locations/{location}/clusters/{cluster}.

pageSize

integer

Optional. The maximum number of topics to return. The service may return fewer than this value. If unset or zero, all topics for the parent is returned.

pageToken

string

Optional. A page token, received from a previous ListTopics call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to ListTopics must match the call that provided the page token.

Output Schema

Response for ListTopics.

ListTopicsResponse

JSON representation
{
  "topics": [
    {
      object (Topic)
    }
  ],
  "nextPageToken": string
}
Fields
topics[]

object (Topic)

The list of topics in the requested parent. The order of the topics is unspecified.

nextPageToken

string

A token that can be sent as page_token to retrieve the next page of results. If this field is omitted, there are no more results.

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: ❌