Skip to main content
Glama

Pay invoice (x402)

pay_invoice
Idempotent

Pay a Billify invoice with x402 v2 over MCP. Call it once without payment to receive the PaymentRequired (exact USDC on Base); sign it and call again with _meta["x402/payment"]. The invoice is marked paid when the facilitator settles.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoiceYesThe invoice's public token (UUID) or its Billify link (billify.org/pay/…, /invoice/…)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations declare the safety profile (not read-only, idempotent, not destructive); the description adds the payment lifecycle that annotations cannot convey — the initial unpaid call, the PaymentRequired response, the required payment meta field, and the fact that the invoice is only marked paid once the facilitator settles. It stops short of describing failure/retry behavior for a rejected or expired payment.

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?

Three tight sentences, front-loaded with purpose before the mechanics of the payment handshake. No filler; every clause carries operational meaning.

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 one-parameter tool with no output schema, the description covers the full invocation cycle and the settlement outcome. Remaining gaps (amount/currency selection beyond 'exact USDC on Base', error handling) are minor and partly implied by the protocol reference.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for the single invoice parameter, so baseline is 3, but the description adds semantics the schema omits: the settlement meta field (_meta["x402/payment"]) the agent must supply on the second call. That extra invocation parameter is real added value.

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?

States a specific verb and resource ('Pay a Billify invoice') plus the protocol used, which cleanly separates it from get_invoice (read) and verify_seller. An agent can identify the tool's role without inspecting the schema.

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?

Gives an explicit two-step invocation procedure: call once to obtain PaymentRequired, sign it, then call again with _meta["x402/payment"]. That is strong operational guidance, though it never contrasts this tool with its siblings or says when not to use it.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources