list_consumer_groups
Retrieve all Kafka consumer groups from a specified environment to monitor and manage data consumption across clusters.
Instructions
Retrieve a list of all Kafka consumer groups.
Args: environment: The environment name.
Returns: A list of consumer group objects.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environment | Yes |
Implementation Reference
- Handler function that executes the list_consumer_groups tool logic by querying the API for consumer groups in the given environment.@mcp.tool() async def list_consumer_groups(environment: str) -> List[Dict[str, Any]]: """ Retrieve a list of all Kafka consumer groups. Args: environment: The environment name. Returns: A list of consumer group objects. """ endpoint = f"/api/v1/environments/{environment}/proxy/api/consumers" return await api_client._make_request("GET", endpoint)
- src/lenses_mcp/server.py:30-30 (registration)Registers the kafka_consumer_groups tools (including list_consumer_groups) with the FastMCP server instance.register_kafka_consumer_groups(mcp)