Skip to main content
Glama

ShallowCodeResearch_get_health_status

Retrieve system health status and operational metrics to monitor availability, resources, and advanced features for comprehensive system oversight.

Instructions

Get comprehensive system health status including advanced monitoring features. Retrieves detailed health information about the system including availability of advanced features, system resources, and operational metrics. Returns basic information if advanced monitoring is not available. Returns: A dictionary containing system health status and metrics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • app.py:274-300 (handler)
    Handler function implementing the get_health_status tool logic, which provides comprehensive system health status. This is likely the core implementation for 'ShallowCodeResearch_get_health_status' given the app context.
    def get_health_status() -> Dict[str, Any]:
        """
        Get comprehensive system health status including advanced monitoring features.
    
        Retrieves detailed health information about the system including availability
        of advanced features, system resources, and operational metrics. Returns
        basic information if advanced monitoring is not available.
    
        Returns:
            Dict[str, Any]: A dictionary containing system health status and metrics
        """
        if not ADVANCED_FEATURES_AVAILABLE:
            return {
                "status": "basic_mode",
                "message": "Advanced features not available. Install 'pip install psutil aiohttp' to enable health monitoring.",
                "system_info": {
                    "python_version": f"{types.__module__}",
                    "gradio_available": True,
                    "modal_available": True
                }
            }
        
        try:
            return health_monitor.get_health_stats()
        except Exception as e:
            return {"error": f"Health monitoring failed: {str(e)}"}
  • app.py:1064-1069 (registration)
    Gradio interface registration of the health status tool as an MCP endpoint with api_name="get_health_status_service". The prefix 'ShallowCodeResearch_' may be applied at the MCP server level based on the app/space name.
    health_btn.click(
        fn=get_health_status,
        inputs=[],
        outputs=health_output,
        api_name="get_health_status_service"
    )
  • Supporting health stats computation used by the main handler via health_monitor.get_health_stats().
    def get_health_stats(self, service: str = None) -> Dict[str, Any]:
        """Get health statistics for a service or all services."""
        with self.lock:
            if service:
                calls = [call for call in self.call_history if call["service"] == service]
            else:
                calls = list(self.call_history)
        
        if not calls:
            return {"error": "No call history available"}
        
        total_calls = len(calls)
        successful_calls = sum(1 for call in calls if call["success"])
        success_rate = successful_calls / total_calls
        
        response_times = [call["response_time"] for call in calls]
        avg_response_time = sum(response_times) / len(response_times)
        
        return {
            "service": service or "all",
            "total_calls": total_calls,
            "success_rate": success_rate,
            "avg_response_time_ms": avg_response_time * 1000,
            "recent_failures": total_calls - successful_calls
        }
Behavior3/5

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

With no annotations provided, the description carries the full burden. It describes the tool's behavior: retrieving health information, including advanced features if available, falling back to basic information otherwise, and returning a dictionary. However, it lacks details on permissions, rate limits, error conditions, or what constitutes 'advanced' versus 'basic' information, leaving behavioral gaps.

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

Conciseness3/5

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

The description is moderately concise but could be more front-loaded. The first sentence states the purpose, but the second sentence partially repeats it ('Retrieves detailed health information'). The third sentence adds useful fallback behavior, and the fourth specifies the return format. Some redundancy exists, but overall it's reasonably structured.

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

Completeness3/5

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

Given the tool's complexity (health monitoring with fallback behavior), no annotations, no output schema, and 0 parameters, the description is adequate but incomplete. It covers the core function and return type but lacks details on output structure, error handling, or integration with sibling tools. For a health-check tool, more context on metrics or thresholds would be beneficial.

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 tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, focusing on the tool's function. A baseline of 4 is applied since it avoids unnecessary parameter details for a zero-parameter tool.

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: 'Get comprehensive system health status including advanced monitoring features' and 'Retrieves detailed health information about the system'. It specifies the resource (system health) and scope (comprehensive/detailed). However, it doesn't explicitly differentiate from sibling tools like get_cache_status or get_performance_metrics, which appear related but distinct.

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. While it mentions 'advanced monitoring features' and 'basic information if advanced monitoring is not available', it doesn't specify use cases, prerequisites, or contrast with sibling tools like get_performance_metrics. This leaves the agent without clear selection criteria.

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/CodeHalwell/gradio-mcp-agent-hack'

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