btcpay_request
Execute BTCPayServer API operations for payment processing, invoice management, and store administration using service-based methods.
Instructions
Execute a BTCPayServer API operation using the service-based approach.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| methodName | Yes | Method name (e.g., "create", "get", "list", "delete") | |
| parameters | No | Parameters for the method (use get_method_info to see required parameters) | |
| serviceName | Yes | Service name (e.g., "payment-requests", "invoices", "lightning") |
Implementation Reference
- src/index.ts:118-139 (registration)Registration of the 'btcpay_request' tool in the MCP ListTools response, including its name, description, and input schema.{ 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'] } }
- src/index.ts:264-301 (handler)Handler for the 'btcpay_request' tool: retrieves the specified service from the registry and executes the requested method with given parameters, returning success or error response.case 'btcpay_request': { const serviceName = args?.serviceName as string; const methodName = args?.methodName as string; const parameters = args?.parameters as Record<string, any> || {}; const service = serviceRegistry.getService(serviceName); if (!service) { return { content: [ { type: 'text', text: `Service "${serviceName}" not found.\n\nAvailable services: ${serviceRegistry.getServiceNames().join(', ')}` } ] }; } try { const result = await service.executeMethod(methodName, parameters); return { content: [ { type: 'text', text: `**${serviceName}.${methodName}** executed successfully:\n\n\`\`\`json\n${JSON.stringify(result, null, 2)}\n\`\`\`` } ] }; } catch (error) { return { content: [ { type: 'text', text: `**Error executing ${serviceName}.${methodName}:**\n\n${error instanceof Error ? error.message : String(error)}\n\nUse get_method_info to check parameter requirements.` } ] }; } }