Skip to main content
Glama

get_method_info

Retrieve detailed parameter requirements and usage examples for specific BTCPayServer API methods to ensure correct implementation.

Instructions

Get detailed parameter requirements and examples for a specific service method.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceNameYesService name (e.g., "payment-requests", "invoices", "lightning")
methodNameYesMethod name (e.g., "create", "get", "list", "delete")

Implementation Reference

  • The main handler for the 'get_method_info' tool. It fetches the service, retrieves its service info, finds the specified method, and constructs a detailed text response with parameters, requirements, and examples.
    case 'get_method_info': { const serviceName = args?.serviceName as string; const methodName = args?.methodName as string; const service = serviceRegistry.getService(serviceName); if (!service) { return { content: [ { type: 'text', text: `Service "${serviceName}" not found.\n\nAvailable services: ${serviceRegistry.getServiceNames().join(', ')}` } ] }; } const serviceInfo = service.getServiceInfo(); const method = serviceInfo.methods.find(m => m.name === methodName); if (!method) { return { content: [ { type: 'text', text: `Method "${methodName}" not found in service "${serviceName}".\n\nAvailable methods: ${serviceInfo.methods.map(m => m.name).join(', ')}` } ] }; } let output = `**${serviceName}.${methodName}**\n\n${method.description}\n\n`; output += "**Parameters:**\n"; for (const [paramName, paramDef] of Object.entries(method.parameters)) { const required = paramDef.required ? " (required)" : " (optional)"; const defaultVal = paramDef.default !== undefined ? ` [default: ${paramDef.default}]` : ""; output += `• **${paramName}** (${paramDef.type})${required}${defaultVal}: ${paramDef.description}\n`; } if (method.examples && method.examples.length > 0) { output += "\n**Examples:**\n"; method.examples.forEach((example, index) => { output += `\n**${index + 1}. ${example.name}**\n${example.description}\n\`\`\`json\n${JSON.stringify(example.parameters, null, 2)}\n\`\`\`\n`; }); } return { content: [ { type: 'text', text: output } ] }; }
  • src/index.ts:100-117 (registration)
    Registration of the 'get_method_info' tool in the ListTools response, including its name, description, and input schema.
    { name: 'get_method_info', description: 'Get detailed parameter requirements and examples for a specific service method.', inputSchema: { type: 'object', properties: { serviceName: { type: 'string', description: 'Service name (e.g., "payment-requests", "invoices", "lightning")' }, methodName: { type: 'string', description: 'Method name (e.g., "create", "get", "list", "delete")' } }, required: ['serviceName', 'methodName'] } },
  • TypeScript interface defining the structure of a ServiceMethod, which is used to provide method details in the tool's response.
    export interface ServiceMethod { name: string; description: string; parameters: Record<string, { type: string; description: string; required: boolean; default?: any; }>; examples?: Array<{ name: string; description: string; parameters: Record<string, any>; }>; }
  • Helper method in BaseService to retrieve method information by name, implementing the core lookup logic mirrored in the tool handler.
    protected getMethodInfo(methodName: string): ServiceMethod | undefined { return this.getServiceInfo().methods.find(m => m.name === methodName); }

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/Abhijay007/btcpayserver-mcp'

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