Skip to main content
Glama

claim_lnurl_withdraw

Claim Bitcoin from an LNURL-withdraw link by submitting the LNURL string and authenticating with the agent key.

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 claimLnurlWithdraw method on the LightningFaucetClient class that makes an API request with action 'claim_lnurl_withdraw' and the lnurl parameter, returning the claim result (message, amountSats, paymentHash, newBalance).
    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 MCP tool handler for 'claim_lnurl_withdraw' - parses input with Zod schema, calls session.requireClient().claimLnurlWithdraw(parsed.lnurl), and returns the formatted response.
    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),
          },
        ],
      };
    }
  • Zod input schema for claim_lnurl_withdraw - validates lnurl as a non-empty string.
    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)
    Tool registration entry in ListToolsRequestSchema handler - defines the tool name 'claim_lnurl_withdraw', description, and input JSON schema.
      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 underlying API call via this.request() that sends the 'claim_lnurl_withdraw' action to the backend API.
    const result = await this.request<ApiResponse & {
      message?: string;
      amount_sats?: number;
      payment_hash?: string;
      new_balance?: number;
    }>('claim_lnurl_withdraw', { lnurl });
Behavior2/5

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

With no annotations, the description carries the full burden. It discloses the requirement for an agent key but does not mention side effects (e.g., if the link is consumed, if funds are transferred, or any other behavioral traits).

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

Conciseness4/5

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

The description is concise (two short sentences) and front-loaded with the action. However, the requirement could be integrated into the first sentence to reduce repetition.

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 a single parameter and no output schema, the description should explain outcome, side effects, and potential errors. It only states the action and a prerequisite, leaving out critical context like fund destination or link usability.

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?

Schema coverage is 100% (single parameter with description). The description repeats the parameter's purpose ('LNURL-withdraw link') without adding new details like format, validation, or examples. Baseline is acceptable.

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 tool's action ('Claim funds from an LNURL-withdraw link') with a specific verb and resource. It distinguishes itself from siblings like 'create_withdraw_link' and 'lnurl_auth' by naming the specific action, but it does not explicitly differentiate.

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?

No guidance on when to use this tool versus alternatives such as 'pay_invoice' or 'lnurl_auth'. The only usage hint is 'REQUIRES AGENT KEY', which is a prerequisite, not a usage guideline.

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