Skip to main content
Glama
rplryan

x402-discovery-mcp

x402_health

Read-onlyIdempotent

Check the real-time health status of any registered x402 service to confirm it is operational.

Instructions

Check real-time health status of any registered x402 service. Free, no payment required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
service_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The function that executes the x402_health tool logic. Makes an HTTP GET request to DISCOVERY_API/health/{service_id}, parses the JSON response, and returns a formatted health report including uptime%, latency, last check time, and quality tier.
    def x402_health(service_id: str) -> str:
        """Get live health status for a specific x402 service.
    
        Args:
            service_id: The service ID from the catalog (e.g. 'ouroboros/discovery').
    
        Returns:
            Current health: uptime%, latency, last check time, HTTP status.
        """
        try:
            with httpx.Client(timeout=10.0) as client:
                resp = client.get(f"{DISCOVERY_API}/health/{service_id}")
                if resp.status_code == 404:
                    return f"Service '{service_id}' not found. Browse catalog: {DISCOVERY_API}/catalog"
                resp.raise_for_status()
                data = resp.json()
        except Exception as e:
            return f"Health check error: {e}"
    
        return (
            f"Health Report: {data.get('name', service_id)}\n"
            f"Status: {data.get('health_status', '?')}\n"
            f"Uptime (7d): {data.get('uptime_pct', '?')}%\n"
            f"Avg Latency: {data.get('avg_latency_ms', '?')}ms\n"
            f"Last Checked: {data.get('last_checked', '?')}\n"
            f"Quality Tier: {data.get('quality_tier', '?')}\n"
            f"Endpoint: {data.get('endpoint_url', data.get('url', '?'))}"
        )
  • server.py:224-232 (registration)
    The @mcp.tool decorator that registers x402_health as an MCP tool with FastMCP, including description and annotations (readOnlyHint=True, destructiveHint=False, idempotentHint=True, openWorldHint=True).
    @mcp.tool(
        description="Check real-time health status of any registered x402 service. Free, no payment required.",
        annotations=ToolAnnotations(
            readOnlyHint=True,
            destructiveHint=False,
            idempotentHint=True,
            openWorldHint=True,
        ),
    )
  • The input schema for x402_health: a single parameter 'service_id' (str) representing the service ID from the catalog (e.g. 'ouroboros/discovery'). The return type is str containing a formatted health report.
    """Get live health status for a specific x402 service.
    
    Args:
        service_id: The service ID from the catalog (e.g. 'ouroboros/discovery').
    
    Returns:
        Current health: uptime%, latency, last check time, HTTP status.
    """
Behavior3/5

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

Annotations already declare readOnly and idempotent hints. The description adds 'real-time' and 'no payment required,' which are minor behavioral clarifications. It does not disclose any additional traits like rate limits or result details.

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

Conciseness5/5

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

The description is only two sentences, each adding distinct value: the first states the primary function, the second clarifies cost. No unnecessary words or repetition.

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

Completeness2/5

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

Despite the presence of an output schema, the description does not mention the parameter or what the health status response contains. For a tool with one required parameter and no schema description, the description should provide more context to be complete.

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

Parameters1/5

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

The input schema has 0% description coverage for the single parameter 'service_id,' and the description does not explain its meaning or format. The parameter's purpose is left entirely to inference from the tool name.

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 checks real-time health status of x402 services, which is a specific verb and resource. It distinguishes from sibling tools like x402_register or x402_browse which have different purposes.

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 mentions 'Free, no payment required,' hinting that other tools may incur costs, but it does not explicitly state when to use this tool versus alternatives or provide exclusions. The purpose is implicit but not directive.

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/rplryan/x402-discovery-mcp'

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