Skip to main content
Glama

add_topic_partitions

Increase the partition count of an existing Kafka topic to handle higher message throughput or improve parallel processing.

Instructions

Add partitions to an existing topic.

Args: environment: The environment name. topic_name: Name of the topic. partitions: New total number of partitions.

Returns: Updated partition count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environmentYes
topic_nameYes
partitionsYes

Implementation Reference

  • The main handler function for the 'add_topic_partitions' tool. It constructs a payload with the new partition count and sends a PUT request to the API endpoint to increase the number of partitions on the specified Kafka topic.
    @mcp.tool() async def add_topic_partitions( environment: str, topic_name: str, partitions: int ) -> Dict[str, Any]: """ Add partitions to an existing topic. Args: environment: The environment name. topic_name: Name of the topic. partitions: New total number of partitions. Returns: Updated partition count. """ payload = {"partitions": partitions} endpoint = f"/api/v1/environments/{environment}/proxy/api/v1/kafka/topics/{topic_name}/partitions" return await api_client._make_request("PUT", endpoint, payload)
  • The call to register_topics(mcp) which defines and registers the 'add_topic_partitions' tool (and other topic tools) with the MCP server.
    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