get_topic_metadata
Retrieve metadata including schema details and tags for a specific Kafka topic in a given environment.
Instructions
Get metadata for a specific topic.
Args: environment: The environment name. topic_name: Name of the topic.
Returns: Topic metadata including schema information and tags.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environment | Yes | ||
| topic_name | Yes |
Implementation Reference
- src/lenses_mcp/tools/topics.py:253-266 (handler)The core handler function implementing the 'get_topic_metadata' MCP tool. It fetches topic metadata via an API GET request to the specified endpoint.@mcp.tool() async def get_topic_metadata(environment: str, topic_name: str) -> Dict[str, Any]: """ Get metadata for a specific topic. Args: environment: The environment name. topic_name: Name of the topic. Returns: Topic metadata including schema information and tags. """ endpoint = f"/api/v1/environments/{environment}/proxy/api/metadata/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) which executes the definition and registration (via @mcp.tool() decorator) of the 'get_topic_metadata' tool.register_topics(mcp)