Skip to main content
Glama

get_method_info

Retrieve detailed parameter requirements and usage examples for BTCPayServer API methods to ensure proper integration and avoid implementation errors.

Instructions

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

Input Schema

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

Implementation Reference

  • Handler logic for the 'get_method_info' tool that retrieves service method details including parameters and examples, formats them into a markdown response.
    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 } ] }; }
  • Schema definition for the 'get_method_info' tool, defining the input parameters serviceName and methodName as required strings.
    { 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'] } },
  • src/index.ts:83-142 (registration)
    Registration of all tools including 'get_method_info' in the ListToolsRequestHandler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ // Service Discovery Tools (Square MCP Pattern) { name: 'get_service_info', description: 'Discover available BTCPayServer services and their methods. Use this to explore what operations are available.', inputSchema: { type: 'object', properties: { serviceName: { type: 'string', description: 'Optional: Get info for a specific service (e.g., "payment-requests", "invoices", "lightning"). If not provided, lists all services.' } } } }, { 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'] } }, { name: 'btcpay_request', description: 'Execute a BTCPayServer API operation using the service-based approach.', 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")' }, parameters: { type: 'object', description: 'Parameters for the method (use get_method_info to see required parameters)' } }, required: ['serviceName', '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