Skip to main content
Glama

claim_lnurl_withdraw

Claim funds from an LNURL-withdraw link using the Lightning Wallet MCP server to process Bitcoin Lightning withdrawals.

Instructions

Claim funds from an LNURL-withdraw link. REQUIRES AGENT KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lnurlYesLNURL-withdraw string to claim from

Implementation Reference

  • The implementation of the claimLnurlWithdraw method which sends the 'claim_lnurl_withdraw' request to the Lightning Faucet API.
    async claimLnurlWithdraw(lnurl: string): Promise<{
      message: string;
      amountSats: number;
      paymentHash: string;
      newBalance: number;
      rawResponse: ApiResponse;
    }> {
      const result = await this.request<ApiResponse & {
        message?: string;
        amount_sats?: number;
        payment_hash?: string;
        new_balance?: number;
      }>('claim_lnurl_withdraw', { lnurl });
    
      return {
        message: result.message || 'Withdrawal claimed',
        amountSats: result.amount_sats || 0,
        paymentHash: result.payment_hash || '',
        newBalance: result.new_balance || 0,
        rawResponse: result,
      };
    }
  • The Zod schema definition for input validation of the claim_lnurl_withdraw tool.
    const ClaimLnurlWithdrawSchema = z.object({
      lnurl: z.string().min(1, 'LNURL string is required').describe('LNURL-withdraw string to claim from'),
    });
  • src/index.ts:768-777 (registration)
    The registration of the 'claim_lnurl_withdraw' tool in the tool list.
      name: 'claim_lnurl_withdraw',
      description: 'Claim funds from an LNURL-withdraw link. REQUIRES AGENT KEY.',
      inputSchema: {
        type: 'object',
        properties: {
          lnurl: { type: 'string', description: 'LNURL-withdraw string to claim from' },
        },
        required: ['lnurl'],
      },
    },
  • The tool call handler for 'claim_lnurl_withdraw' which invokes the client method.
    case 'claim_lnurl_withdraw': {
      const parsed = ClaimLnurlWithdrawSchema.parse(args);
      const result = await session.requireClient().claimLnurlWithdraw(parsed.lnurl);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: true,
              message: result.message || 'Withdrawal claimed',
              amount_sats: result.amountSats,
              payment_hash: result.paymentHash,
              new_balance: result.newBalance,
            }, null, 2),
          },
        ],
      };
    }

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