Skip to main content
Glama

get_topic_partitions

Retrieve partition details for Kafka topics, including message counts and byte sizes, to monitor data distribution and performance across clusters.

Instructions

Retrieve detailed partition information including messages and bytes (v2 endpoint).

Args: environment: The environment name. topic_name: Name of the topic.

Returns: Partition details with message counts, bytes, and JMX timestamp.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environmentYes
topic_nameYes

Implementation Reference

  • The handler function for the 'get_topic_partitions' tool. Decorated with @mcp.tool() for automatic registration within the register_topics function. It constructs an API endpoint and makes a GET request to retrieve detailed partition information including messages, bytes, and JMX timestamp.
    @mcp.tool() async def get_topic_partitions(environment: str, topic_name: str) -> Dict[str, Any]: """ Retrieve detailed partition information including messages and bytes (v2 endpoint). Args: environment: The environment name. topic_name: Name of the topic. Returns: Partition details with message counts, bytes, and JMX timestamp. """ endpoint = f"/api/v1/environments/{environment}/proxy/api/v2/topics/{topic_name}/partitions" return await api_client._make_request("GET", endpoint)
  • Invocation of register_topics(mcp), which defines and registers the get_topic_partitions tool among others.
    register_topics(mcp)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/stereosky/lenses-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server