get_environment
Retrieve a specific Lenses environment by name to access its status, metrics, and metadata for Kafka cluster management.
Instructions
Retrieves a single Lenses environment by name.
Args: name: The name of the environment to retrieve.
Returns: A dictionary containing the environment's details including status, metrics, and metadata.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Implementation Reference
- The core handler function for the 'get_environment' MCP tool. It fetches the environment details from the Lenses API using the provided name. The @mcp.tool() decorator registers it with the MCP server.@mcp.tool() async def get_environment(name: str) -> Dict[str, Any]: """ Retrieves a single Lenses environment by name. Args: name: The name of the environment to retrieve. Returns: A dictionary containing the environment's details including status, metrics, and metadata. """ if not name: raise ValueError("Environment name is required") return await api_client._make_request("GET", f"/api/v1/environments/{name}")
- src/lenses_mcp/server.py:28-28 (registration)Invocation of register_environments(mcp) in the main server file, which defines and registers the 'get_environment' tool along with other environment tools.register_environments(mcp)