Skip to main content
Glama

pay

Process Lightning Network payments by submitting bolt11 invoices to transfer funds through the MCP Money server.

Instructions

Pay a Lightning invoice

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bolt11YesLightning invoice to pay

Implementation Reference

  • The pay method in MCPWallet class that executes the Lightning payment using the underlying NDKCashuWallet's lnPay method. This is the core handler for the 'pay' tool.
    async pay(bolt11: string): Promise<any> {
      if (!this.wallet) throw new Error('Wallet not initialized');
      
      try {
        const result = await this.wallet.lnPay({ pr: bolt11 });
        
        this.saveWallet();
        return result;
      } catch (error) {
        console.error('Error making payment:', error);
        throw error;
      }
    }
  • Defines the input schema, description, and name for the 'pay' tool, returned in the ListTools response for MCP tool discovery.
    {
      name: 'pay',
      description: 'Pay a Lightning invoice',
      inputSchema: {
        type: 'object',
        properties: {
          bolt11: { type: 'string', description: 'Lightning invoice to pay' }
        },
        required: ['bolt11']
      }
    },
  • wallet.ts:640-661 (registration)
    Registers and handles the 'pay' tool invocation in the CallToolRequestSchema handler by calling the wallet.pay method and formatting the standardized MCP response.
    case 'pay':
      const { bolt11 } = args;
      if (!bolt11) {
        throw new Error('bolt11 invoice is required');
      }
      const payResult = await this.wallet.pay(bolt11);
      
      if (payResult && payResult.success !== false) {
        return { 
          content: [{ type: 'text', text: 'Payment successful' }],
          success: true,
          bolt11,
          payResult
        };
      } else {
        return { 
          content: [{ type: 'text', text: 'Payment failed' }],
          success: false,
          bolt11,
          payResult
        };
      }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a payment operation (implying a write/mutation), but doesn't mention permission requirements, whether it's idempotent, what happens on failure, or any rate limits. For a financial transaction tool, this is a significant gap in behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that states exactly what the tool does with zero wasted words. It's appropriately sized for a single-parameter tool and gets straight to the point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a financial payment tool with no annotations and no output schema, the description is insufficient. It doesn't explain what happens after payment (success/failure states, return values), doesn't mention security considerations, and provides minimal behavioral context despite the tool's significant implications.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage, with the 'bolt11' parameter clearly documented as 'Lightning invoice to pay'. The description adds no additional parameter information beyond what's already in the schema, so it meets the baseline for high schema coverage without adding extra value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Pay') and the resource ('a Lightning invoice'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'deposit' or 'zap', but the specificity of 'Lightning invoice' provides inherent distinction for those familiar with the domain.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'deposit' or 'zap', nor does it mention any prerequisites or conditions for use. It simply states what the tool does without contextual usage information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/pablof7z/mcp-money'

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