Skip to main content
Glama

ping_system

Check if an EMS system is online and responsive by verifying its operational status with a system ID.

Instructions

Check if an EMS system is online and responsive.

Args: ems_system_id: EMS system ID.

Returns: System status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ems_system_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Main handler function for ping_system tool. Decorated with @mcp.tool, it calls the EMS API ping endpoint and formats the response to show system ONLINE/OFFLINE status. Handles multiple response types (bool, str, dict) and API errors gracefully.
    @mcp.tool
    async def ping_system(ems_system_id: int) -> str:
        """Check if an EMS system is online and responsive.
    
        Args:
            ems_system_id: EMS system ID.
    
        Returns:
            System status.
        """
        client = get_client()
        try:
            path = f"/api/v2/ems-systems/{ems_system_id}/ping"
            response = await client.get(path)
            # Ping response can be a boolean, a string, or a dict with a message
            if isinstance(response, bool):
                status = "ONLINE" if response else "OFFLINE"
                return f"EMS System {ems_system_id} is {status}."
            elif isinstance(response, str):
                return f"EMS System {ems_system_id} is ONLINE. Response: {response}"
            elif isinstance(response, dict):
                message = response.get("message", "System is accessible")
                return f"EMS System {ems_system_id} is ONLINE. {message}"
            else:
                return f"EMS System {ems_system_id} is ONLINE."
        except EMSNotFoundError:
            return f"Error: EMS system {ems_system_id} not found."
        except EMSAPIError as e:
            return f"EMS System {ems_system_id} is OFFLINE or unreachable: {e.message}"
  • Pydantic schema definition for PingResponse model that defines the expected response structure from the EMS ping endpoint, including timestamp, server_time, status, and extra fields.
    class PingResponse(BaseModel):
        """Response from EMS system ping endpoint."""
    
        timestamp: datetime | None = None
        server_time: str | None = Field(default=None, alias="serverTime")
        status: str = "ok"
        extra: dict[str, Any] = Field(default_factory=dict)
    
        model_config = {"extra": "allow"}
  • Module-level registration where ping_system is imported from assets.py and exported in __all__, making it available as part of the tools package.
    from ems_mcp.tools.assets import (
        get_assets,
        ping_system,
    )
    from ems_mcp.tools.discovery import (
        find_fields,
        get_field_info,
        get_result_id,
        list_databases,
        list_ems_systems,
        search_analytics,
    )
    from ems_mcp.tools.query import (
        query_database,
        query_flight_analytics,
    )
    
    __all__ = [
        "list_ems_systems",
        "list_databases",
        "find_fields",
        "get_field_info",
        "get_result_id",
        "search_analytics",
        "query_database",
        "query_flight_analytics",
        "get_assets",
        "ping_system",
    ]
  • Server initialization where ems_mcp.tools.assets module is imported, triggering the @mcp.tool decorator registration and making ping_system available to the FastMCP server.
    # Import tools and resources to register them with the mcp instance
    # This must happen after mcp is created
    import ems_mcp.tools.assets  # noqa: E402, F401
    import ems_mcp.tools.discovery  # noqa: E402, F401
    import ems_mcp.tools.query  # noqa: E402, F401
    import ems_mcp.prompts  # noqa: E402, F401
    import ems_mcp.resources  # noqa: E402, F401
  • Documentation reference in workflow guide mentioning ping_system as a tool to check if a system is online.
    - ping_system checks if a system is online.
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 the tool checks if a system is 'online and responsive', which implies a read-only, non-destructive operation, but doesn't specify behavioral traits like timeout behavior, error handling, performance characteristics, or authentication requirements. For a tool with zero annotation coverage, this leaves significant gaps in understanding how it behaves in practice.

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 appropriately sized and front-loaded, with the core purpose stated first ('Check if an EMS system is online and responsive'), followed by brief sections for Args and Returns. However, the structure includes redundant labeling ('Args:', 'Returns:') that adds minor verbosity without enhancing clarity, slightly reducing efficiency.

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, simple health check), no annotations, and the presence of an output schema (which handles return values), the description is reasonably complete. It covers the purpose and parameter semantics adequately, though it lacks details on behavioral aspects like error conditions or performance, which would be beneficial for full contextual understanding.

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 'ems_system_id' by specifying it as 'EMS system ID', which clarifies its purpose beyond the schema's type (integer). With 0% schema description coverage and only one parameter, this compensation is effective, though it doesn't detail format constraints (e.g., valid ID ranges). The baseline for 0 parameters would be 4, but here the description adequately supplements the minimal schema.

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

Purpose5/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 with specific verb ('Check') and resource ('EMS system'), specifying it verifies if the system is 'online and responsive'. This distinguishes it from sibling tools like 'list_ems_systems' (which lists systems) or 'get_assets' (which retrieves asset data), making the purpose unambiguous and well-differentiated.

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

Usage Guidelines3/5

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

The description implies usage context by stating it checks if 'an EMS system is online and responsive', suggesting it should be used for health/availability monitoring. However, it doesn't explicitly state when to use this versus alternatives (e.g., whether it's for pre-operation checks or real-time monitoring), nor does it provide exclusions or prerequisites, leaving some ambiguity in optimal usage scenarios.

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/mattsq/ems-mcp'

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