update_consumer_group_offsets
Modify Kafka consumer group offsets for specific topic-partition pairs to control message processing positions in Lenses MCP Server.
Instructions
Update the offset 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 offset objects.
Returns: The result of the update operation.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environment | Yes | ||
| group_id | Yes | ||
| offsets | Yes |
Implementation Reference
- The async handler function that implements the tool logic by making a PUT request to the API endpoint to update the consumer group offsets.@mcp.tool() async def update_consumer_group_offsets( environment: str, group_id: str, offsets: List[Dict[str, Any]] ) -> Dict[str, Any]: """ Update the offset 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 offset objects. Returns: The result of the update operation. """ endpoint = f"/api/v1/environments/{environment}/proxy/api/consumers/{group_id}/offsets" return await api_client._make_request("PUT", endpoint, json=offsets)
- src/lenses_mcp/server.py:30-30 (registration)Registers the kafka_consumer_groups tools module, which includes the update_consumer_group_offsets tool, with the MCP server.register_kafka_consumer_groups(mcp)