Skip to main content
Glama

health_check

Verify X402 API service availability and response status to ensure the production-ready micropayment system is operational for AI agents.

Instructions

Check if the X402 API service is available and responding

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'health_check' tool. It attempts to GET /health from the configured API baseURL, returns healthy status with response data if successful, or error status if failed.
    case "health_check": { try { // Try health endpoint const response = await axios.get(`${baseURL}/health`, { timeout: 5000 }); return { content: [ { type: "text", text: JSON.stringify( { status: "healthy", api_url: baseURL, payment_enabled: paymentEnabled, network: network, response: response.data, }, null, 2 ), }, ], }; } catch (error: any) { return { content: [ { type: "text", text: JSON.stringify( { status: "error", api_url: baseURL, payment_enabled: paymentEnabled, network: network, error: error.message, note: "API may be down or health endpoint not available", }, null, 2 ), }, ], }; } }
  • index.ts:138-145 (registration)
    The registration of the 'health_check' tool in the ListTools response, including its name, description, and empty input schema.
    { name: "health_check", description: "Check if the X402 API service is available and responding", inputSchema: { type: "object", properties: {}, }, },
  • The input schema for the 'health_check' tool, which requires no parameters (empty object).
    inputSchema: { type: "object", properties: {}, },

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/CodaLabs-xyz/Template-x402-Mcp'

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