Skip to main content
Glama
lensesio

Lenses MCP Server

by lensesio

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

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

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

With no annotations provided, the description carries full burden. It mentions retrieving details from a 'v2 endpoint', which hints at API versioning, but lacks critical behavioral info such as whether it's read-only, requires specific permissions, has rate limits, or how it handles errors. This is inadequate for a tool with potential complexity.

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 (Args, Returns) and front-loaded key information. It's concise with no redundant sentences, though the parameter explanations could be more informative without adding bulk.

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 2 parameters with 0% schema coverage and no annotations, but with an output schema present (implied by 'Returns'), the description is moderately complete. It covers purpose and return values but lacks behavioral context and detailed parameter semantics, making it adequate but with notable gaps for effective tool use.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate. It lists the two parameters ('environment' and 'topic_name') in the Args section, but adds minimal semantic context beyond their names (e.g., no explanation of what an 'environment' entails or format examples). This provides basic mapping but falls short of fully clarifying parameter meanings.

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

Purpose4/5

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

The description clearly states the verb ('Retrieve') and resource ('detailed partition information'), specifying it includes messages and bytes and uses a v2 endpoint. It distinguishes itself from siblings like 'get_topic_metadata' or 'get_topic' by focusing on partition-level details, though it doesn't explicitly contrast with them.

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?

No guidance is provided on when to use this tool versus alternatives like 'get_topic_metadata' or 'list_topic_metadata'. The description mentions it's for partition details, but doesn't specify scenarios or prerequisites, leaving usage unclear relative to siblings.

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