get_topic
Retrieve detailed information about Kafka topics including partitions, consumers, and configuration settings for data management and analysis.
Instructions
Retrieve information about a specific topic.
Args: environment: The environment name. topic_name: Name of the topic.
Returns: Detailed topic information including partitions, consumers, config, etc.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environment | Yes | ||
| topic_name | Yes |
Implementation Reference
- src/lenses_mcp/tools/topics.py:30-44 (handler)The core handler function for the 'get_topic' MCP tool. Decorated with @mcp.tool() which also handles schema inference from the function signature and docstring, and registers the tool with the FastMCP instance passed to register_topics.@mcp.tool() async def get_topic(environment: str, topic_name: str) -> Dict[str, Any]: """ Retrieve information about a specific topic. Args: environment: The environment name. topic_name: Name of the topic. Returns: Detailed topic information including partitions, consumers, config, etc. """ endpoint = f"/api/v1/environments/{environment}/proxy/api/topics/{topic_name}" return await api_client._make_request("GET", endpoint)
- src/lenses_mcp/server.py:33-33 (registration)The call to register_topics(mcp) in the main server setup, which defines and registers the get_topic tool (along with other topic tools) to the MCP server instance.register_topics(mcp)