delete_consumer_group_offsets
Remove stored offset data for specific topic-partition assignments in a Kafka consumer group to reset consumption positions or resolve processing issues.
Instructions
Delete offsets for a consumer group topic-partition tuples.
Args: environment: The environment name. group_id: The ID of the consumer group. offsets: A list of topic-partition objects.
Returns: The result of the delete operation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environment | Yes | ||
| group_id | Yes | ||
| offsets | Yes |
Implementation Reference
- Handler function that implements the tool logic by constructing the API endpoint and making a POST request to delete the specified consumer group offsets.async def delete_consumer_group_offsets( environment: str, group_id: str, offsets: List[Dict[str, Any]] ) -> Dict[str, Any]: """ Delete offsets for a consumer group topic-partition tuples. Args: environment: The environment name. group_id: The ID of the consumer group. offsets: A list of topic-partition objects. Returns: The result of the delete operation. """ endpoint = f"/api/v1/environments/{environment}/proxy/api/consumers/{group_id}/offsets/delete" return await api_client._make_request("POST", endpoint, json=offsets)
- src/lenses_mcp/tools/kafka_consumer_groups.py:60-60 (registration)The @mcp.tool() decorator directly above the handler registers it as an MCP tool when the register_kafka_consumer_groups function is called.@mcp.tool()
- src/lenses_mcp/server.py:30-30 (registration)Top-level call to register_kafka_consumer_groups(mcp) which triggers the registration of the delete_consumer_group_offsets tool among others.register_kafka_consumer_groups(mcp)
- Type annotations in the function signature define the input schema: environment (str), group_id (str), offsets (List[Dict[str, Any]]). The docstring provides further description.environment: str, group_id: str, offsets: List[Dict[str, Any]] ) -> Dict[str, Any]: