Skip to main content
Glama
lensesio

Lenses MCP Server

by lensesio

list_consumer_groups_by_topic

Identify which consumer groups are subscribed to a specific Kafka topic to monitor data consumption patterns and group activity.

Instructions

Retrieve a list of consumer groups by a specific topic.

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

Returns: A list of consumer group objects.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environmentYes
topicYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool handler function decorated with @mcp.tool(), implementing the logic to list consumer groups for a given topic by making an API GET request.
    @mcp.tool()
    async def list_consumer_groups_by_topic(environment: str, topic: str) -> List[Dict[str, Any]]:
        """
        Retrieve a list of consumer groups by a specific topic.
        
        Args:
            environment: The environment name.
            topic: The name of the topic.
        
        Returns:
            A list of consumer group objects.
        """
        endpoint = f"/api/v1/environments/{environment}/proxy/api/consumers/{topic}"
        return await api_client._make_request("GET", endpoint)
  • Top-level call to register_kafka_consumer_groups which registers the list_consumer_groups_by_topic tool (and other Kafka consumer group tools).
    register_kafka_consumer_groups(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 offers minimal behavioral context. It mentions the return type ('list of consumer group objects') but doesn't describe pagination, rate limits, authentication requirements, error conditions, or what happens if the topic doesn't exist. For a read operation with zero annotation coverage, this is insufficient.

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. Every sentence adds value, though the purpose statement could be slightly more specific about what 'retrieve' entails in this context.

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 has an output schema (which handles return value documentation) and only 2 parameters, the description is reasonably complete for a simple lookup tool. However, with no annotations and minimal behavioral context, it leaves gaps about operational constraints and error handling that could affect agent usage.

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%, but the description's Args section documents both parameters with basic semantics ('environment name' and 'topic name'). However, it doesn't provide format details, valid values, or examples. Since there are only 2 parameters and the description covers them, baseline 3 is appropriate, though more detail would improve utility.

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 'list of consumer groups by a specific topic', making the purpose understandable. It distinguishes from the sibling 'list_consumer_groups' by specifying topic-based filtering, but doesn't explicitly contrast with other consumer group tools like 'delete_consumer_group'.

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 about when to use this tool versus alternatives. While the description implies it's for listing consumer groups filtered by topic, it doesn't mention when to use this instead of 'list_consumer_groups' (which likely lists all groups) or other consumer group operations like 'delete_consumer_group'.

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