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
| Name | Required | Description | Default |
|---|---|---|---|
| lnurl | Yes | LNURL-withdraw string to claim from |
Implementation Reference
- src/lightning-faucet.ts:1204-1225 (handler)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, }; } - src/index.ts:268-270 (schema)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'], }, }, - src/index.ts:1655-1672 (handler)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), }, ], }; }