Skip to main content
Glama

get_deposit_invoice

Generate a Lightning invoice to deposit Bitcoin sats into your operator account balance for funding payments and accessing paid APIs.

Instructions

Create a Lightning invoice to fund your operator account. Pay this invoice to add sats to your balance.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amount_satsYesAmount in satoshis to deposit

Implementation Reference

  • Handler for the "get_deposit_invoice" tool in the MCP server.
    case 'get_deposit_invoice': {
      const parsed = GetDepositInvoiceSchema.parse(args);
      const result = await session.requireClient().getDepositInvoice(parsed.amount_sats);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              message: `Deposit invoice created for ${parsed.amount_sats} sats`,
              bolt11: result.bolt11,
              payment_hash: result.paymentHash,
              expires_at: result.expiresAt,
              payment_url: result.paymentUrl,
              qr_url: result.qrUrl,
            }, null, 2),
          },
        ],
      };
    }
  • The actual API client method that communicates with the backend for 'get_deposit_invoice'.
    async getDepositInvoice(amountSats: number): Promise<{
      bolt11: string;
      paymentHash: string;
      expiresAt: string;
      paymentUrl?: string;
      qrUrl?: string;
      rawResponse: DepositInvoiceResponse;
    }> {
      const result = await this.request<DepositInvoiceResponse>('create_deposit', {
        amount_sats: amountSats,
      });
    
      const bolt11 = result.bolt11 || result.invoice;
      if (!bolt11) {
        throw new Error('No invoice returned from API');
      }
    
      // Compute expires_at from expires_in if not provided
      let expiresAt = result.expires_at || '';
      if (!expiresAt && result.expires_in) {
        const expiryDate = new Date(Date.now() + result.expires_in * 1000);
        expiresAt = expiryDate.toISOString();
      }
    
      return {
        bolt11,
        paymentHash: result.payment_hash || '',
        expiresAt,
        paymentUrl: result.payment_url,
        qrUrl: result.qr_url,
        rawResponse: result,
      };
    }
  • Input schema definition for the get_deposit_invoice tool.
    const GetDepositInvoiceSchema = z.object({
      amount_sats: z.number().int().min(100).max(10_000_000).describe('Amount in satoshis to deposit'),
    });
  • src/index.ts:404-413 (registration)
    Registration definition for the get_deposit_invoice tool.
      name: 'get_deposit_invoice',
      description: 'Create a Lightning invoice to fund your operator account. Pay this invoice to add sats to your balance.',
      inputSchema: {
        type: 'object',
        properties: {
          amount_sats: { type: 'integer', minimum: 100, description: 'Amount in satoshis to deposit' },
        },
        required: ['amount_sats'],
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool creates an invoice for funding, implying a read-only operation that generates a payment request, but lacks details on permissions, rate limits, response format, or whether the invoice is stored or ephemeral. This is insufficient for a tool with no annotation coverage.

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 concise and front-loaded, consisting of two sentences that directly explain the tool's purpose and outcome with no wasted words. It efficiently communicates the essential information without unnecessary elaboration.

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?

Given the lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like authentication needs, error handling, or what the invoice output looks like (e.g., a string or object). For a tool that creates financial transactions, more context is needed to ensure proper agent usage.

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 input schema has 100% description coverage, with the parameter 'amount_sats' clearly documented. The description adds no additional parameter semantics beyond what the schema provides, such as explaining the minimum value or typical usage amounts, so it meets the baseline for high schema coverage without 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 ('Create a Lightning invoice') and purpose ('to fund your operator account', 'add sats to your balance'), making the tool's function explicit. However, it doesn't distinguish this from sibling tools like 'create_invoice' or 'fund_agent', which appear related to invoice creation and funding operations, leaving some ambiguity about when to use this specific tool.

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. It mentions the purpose but doesn't specify prerequisites, exclusions, or compare it to siblings such as 'create_invoice' or 'fund_agent', leaving the agent to infer usage context without explicit direction.

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/lightningfaucet/lightning-wallet-mcp'

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