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
| Name | Required | Description | Default |
|---|---|---|---|
| methodName | Yes | Method name (e.g., "create", "get", "list", "delete") | |
| serviceName | Yes | Service name (e.g., "payment-requests", "invoices", "lightning") |
Implementation Reference
- src/index.ts:209-262 (handler)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 } ] }; }
- src/index.ts:100-117 (schema)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'] } } ], }; });