Skip to main content
Glama
lensesio

Lenses MCP Server

by lensesio

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but lacks behavioral details. It mentions the tool modifies an existing topic (implying mutation) but doesn't disclose permissions needed, whether changes are reversible, potential impacts on existing data, or rate limits. The description adds minimal context beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (purpose, Args, Returns) and uses minimal sentences. Each part earns its place, though the 'Returns' section could be slightly more informative given the output schema exists.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's mutation nature, no annotations, and 3 parameters, the description is moderately complete. It covers parameters and return value, but lacks behavioral context (e.g., safety, side effects). The output schema reduces need for return details, but overall gaps remain for a mutation tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description compensates by explaining all three parameters in the 'Args' section, clarifying their purposes (e.g., 'New total number of partitions' for 'partitions'). This adds meaningful semantics beyond the bare schema, though it doesn't detail formats or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Add partitions') and target resource ('to an existing topic'), distinguishing it from sibling tools like 'create_topic' or 'update_topic_config'. It explicitly mentions the verb and resource with no ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'update_topic_config' or 'create_topic', nor does it mention prerequisites (e.g., topic must exist) or exclusions. It only states the basic purpose without contextual usage advice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/lensesio/lenses-mcp'

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