update_topic_config
Modify Kafka topic settings like retention time and other configurations across different environments using the Lenses MCP Server.
Instructions
Update topic configuration.
Args: environment: The environment name. topic_name: Name of the topic. configs: List of config key-value pairs [{"key": "retention.ms", "value": "86400000"}].
Returns: Success message.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environment | Yes | ||
| topic_name | Yes | ||
| configs | Yes |
Implementation Reference
- src/lenses_mcp/tools/topics.py:156-175 (handler)The main handler function for the 'update_topic_config' tool. It constructs a payload with the configs and sends a PUT request to the Lenses API endpoint to update the topic configuration.@mcp.tool() async def update_topic_config( environment: str, topic_name: str, configs: List[Dict[str, str]] ) -> str: """ Update topic configuration. Args: environment: The environment name. topic_name: Name of the topic. configs: List of config key-value pairs [{"key": "retention.ms", "value": "86400000"}]. Returns: Success message. """ payload = {"configs": configs} endpoint = f"/api/v1/environments/{environment}/proxy/api/configs/topics/{topic_name}" return await api_client._make_request("PUT", endpoint, payload)
- src/lenses_mcp/server.py:33-33 (registration)Invokes register_topics(mcp) which registers the update_topic_config tool (among others) with the MCP server.register_topics(mcp)