delete_consumer_group_topic_partition_offset
Remove offset data for a specific topic-partition in a Kafka consumer group to reset consumption position or resolve processing issues.
Instructions
Delete the offset for a topic-partition for a given group.
Args: environment: The environment name. group_id: The ID of the consumer group. topic: The topic name. partition: The partition number.
Returns: The result of the delete operation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environment | Yes | ||
| group_id | Yes | ||
| topic | Yes | ||
| partition | Yes |
Implementation Reference
- The handler function implementing the `delete_consumer_group_topic_partition_offset` tool. It constructs an API endpoint and sends a DELETE request to remove the offset for the specified consumer group, topic, and partition.@mcp.tool() async def delete_consumer_group_topic_partition_offset( environment: str, group_id: str, topic: str, partition: int ) -> Dict[str, Any]: """ Delete the offset for a topic-partition for a given group. Args: environment: The environment name. group_id: The ID of the consumer group. topic: The topic name. partition: The partition number. Returns: The result of the delete operation. """ endpoint = f"/api/v1/environments/{environment}/proxy/api/consumers/{group_id}/topics/{topic}/partitions/{partition}/offsets" return await api_client._make_request("DELETE", endpoint)
- src/lenses_mcp/server.py:30-30 (registration)Registration of the Kafka consumer groups tools module, which includes the `delete_consumer_group_topic_partition_offset` tool, by calling the register function on the MCP instance.register_kafka_consumer_groups(mcp)
- src/lenses_mcp/server.py:14-14 (registration)Import of the `register_kafka_consumer_groups` function used to register the tools.from tools.kafka_consumer_groups import register_kafka_consumer_groups