Skip to main content
Glama

service_info

Retrieve X402 API service details including available endpoints, pricing information, and payment requirements for making micropayment-based API calls.

Instructions

Get information about the X402 API service including available endpoints, pricing, and payment requirements

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function for the 'service_info' tool. Fetches X402 service discovery metadata from the /.well-known/x402 endpoint using axios. Returns structured JSON with service info or fallback basic connection details if the endpoint is unavailable.
    case "service_info": { // Fetch service discovery metadata from /.well-known/x402 try { const response = await axios.get(`${baseURL}/.well-known/x402`); return { content: [ { type: "text", text: JSON.stringify( { service_discovery: true, ...response.data, connection_info: { base_url: baseURL, payment_enabled: paymentEnabled, network: network, }, }, null, 2 ), }, ], }; } catch (error: any) { // If service discovery not available, return basic info return { content: [ { type: "text", text: JSON.stringify( { service_discovery: false, message: "Service discovery endpoint not available", connection_info: { base_url: baseURL, payment_enabled: paymentEnabled, network: network, }, note: "API may not support X402 protocol or /.well-known/x402 endpoint", }, null, 2 ), }, ], }; } }
  • Input schema definition for the 'service_info' tool. Defines an empty object (no required input parameters).
    inputSchema: { type: "object", properties: {}, },
  • index.ts:130-137 (registration)
    Registration of the 'service_info' tool in the ListToolsRequestSchema handler response. Includes name, description, and input schema.
    { name: "service_info", description: "Get information about the X402 API service including available endpoints, pricing, and payment requirements", 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