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
| Name | Required | Description | Default |
|---|---|---|---|
| environment | Yes | ||
| topic | Yes |
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)
- src/lenses_mcp/server.py:30-30 (registration)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)