Skip to main content
Glama

l402-pay

Destructive

Confirm a pending L402 payment and store credentials so subsequent requests succeed. Polls the payment server for settlement, then caches the credential for future use.

Instructions

Confirm payment and store credentials. Call this after l402-fetch returns a 402 with a paymentHash — polls the payment server for settlement (up to 30s for human wallet), then stores the credential so the next l402-fetch succeeds. For human wallets, call this immediately after showing the payment URL to the user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
methodNoPayment method override. Defaults to wallet priority: NWC > Cashu > LNURLcash > human.
invoiceNoBOLT-11 invoice to pay. Optional if paymentHash matches a cached challenge from l402-discover.
macaroonNoMacaroon from the L402 challenge. Optional if paymentHash matches a cached challenge.
paymentHashNoPayment hash to look up cached challenge from l402-discover.
Install Server

TDQS

A4.2/5.0
Behavior4/5

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

Beyond the annotations, the description discloses meaningful runtime behavior: it 'polls the payment server for settlement' and can block 'up to 30s for human wallet,' and it stores a credential as a side effect. This adds real context about latency and state mutation without contradicting the openWorldHint/destructiveHint annotations.

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 three sentences with no filler. It front-loads the essential action, then gives the triggering condition, timing behavior, and a human-wallet special case. Every sentence earns its place.

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

Completeness4/5

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

For a consequential payment tool with no output schema, the description covers preconditions, blocking behavior, side effects, and sequencing well. It doesn't describe failure modes or return values, but the annotations and sibling context (l402-fetch, l402-discover) fill most gaps.

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 description coverage is 100%, so the schema already documents all four parameters in detail. The description references paymentHash and the cached-challenge flow, but it doesn't add parameter meaning beyond what the input schema provides, so the baseline of 3 is appropriate.

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

Purpose5/5

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

The description opens with a clear verb+resource pair, 'Confirm payment and store credentials,' and then anchors the tool's role to a concrete trigger: 'Call this after l402-fetch returns a 402 with a paymentHash.' This specific integration point makes it easy to distinguish from siblings like l402-fetch or l402-store-token.

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

Usage Guidelines4/5

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

It provides explicit when-to-use guidance: after l402-fetch returns a 402, and it adds a temporal nuance for human wallets ('call this immediately after showing the payment URL to the user'). It doesn't enumerate alternative tools or explicit when-not-to-use conditions, so it falls just short of a 5.

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

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/forgesworn/402-mcp'

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