Skip to main content
Glama
lensesio

Lenses MCP Server

by lensesio

check_environment_health

Monitor the health status of a Lenses environment by checking agent connections and identifying potential issues.

Instructions

Checks the health status of a Lenses environment.

Args: name: The name of the environment to check.

Returns: Health status information including agent connection and any issues.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'check_environment_health' tool. It is decorated with @mcp.tool() which registers it with the MCP server. The function retrieves the environment details, checks the agent connection status, scans for issues in metrics, computes overall health, and returns a structured health status report including summary metrics.
    @mcp.tool()
    async def check_environment_health(name: str) -> Dict[str, Any]:
        """
        Checks the health status of a Lenses environment.
        
        Args:
            name: The name of the environment to check.
        
        Returns:
            Health status information including agent connection and any issues.
        """
        env = await get_environment(name)
        
        health_status = {
            "environment": name,
            "healthy": False,
            "agent_connected": False,
            "issues": []
        }
        
        if "status" in env:
            health_status["agent_connected"] = env["status"].get("agent_connected", False)
            
            if env["status"]["agent_connected"] and "agent" in env["status"]:
                agent_data = env["status"]["agent"]
                metrics = agent_data.get("metrics", {})
                
                # Check for issues
                if "other" in metrics and metrics["other"].get("num_issues", 0) > 0:
                    health_status["issues"].append(f"Found {metrics['other']['num_issues']} issues")
                
                # Basic health check
                health_status["healthy"] = (
                    health_status["agent_connected"] and 
                    len(health_status["issues"]) == 0
                )
                
                # Add summary metrics
                health_status["summary"] = {
                    "kafka_brokers": metrics.get("kafka", {}).get("num_brokers", 0),
                    "topics": metrics.get("data", {}).get("num_topics", 0),
                    "consumers": metrics.get("apps", {}).get("num_consumers", 0),
                    "connectors": metrics.get("connect", {}).get("num_connectors", 0)
                }
        
        return health_status
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that the tool returns 'health status information including agent connection and any issues,' which gives some insight into output behavior. However, it lacks critical details such as whether this is a read-only operation (implied but not stated), potential side effects, error handling, authentication requirements, or rate limits. For a health-check tool with zero annotation coverage, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured and concise, using a brief purpose statement followed by 'Args:' and 'Returns:' sections. Every sentence adds value: the first states the tool's function, and the subsequent lines explain the parameter and return value. There's no redundant information, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (one parameter, no nested objects) and the presence of an output schema (which handles return value details), the description is reasonably complete. It covers the purpose, parameter meaning, and general return content. However, it could improve by addressing behavioral aspects like safety or usage context, especially since no annotations are provided to fill those gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context for the single parameter 'name' by specifying it as 'The name of the environment to check.' This clarifies the parameter's role beyond the schema's basic type information. With 0% schema description coverage and only one parameter, the description effectively compensates by providing clear semantics, though it doesn't detail format constraints (e.g., case sensitivity).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Checks the health status of a Lenses environment.' It specifies the verb ('checks') and resource ('health status of a Lenses environment'), making the intent unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_environment' or 'list_environments', which likely provide different types of environment information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_environment' (which might retrieve configuration details) or 'list_environments' (which might list environments without health checks). There's no context about prerequisites, timing, or exclusions for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lensesio/lenses-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server