Skip to main content
Glama

authorize_x402_ap2

Paid pre-payment trust gate. Use after create_ap2_challenge and after receiving the merchant's real x402 PAYMENT-REQUIRED challenge, but before paying the merchant. Verifies AP2 v0.2 authority and binds approval to the exact merchant challenge and HTTP request. On approval returns authorization_token; next pay the merchant, then call verify_settlement. Machine price: $0.001 via x402. If authorization is denied, the Trust fee is not settled/charged.

Input Schema

NameRequiredDescriptionDefault
nonceNoOptional caller nonce for correlation; do not reuse across distinct purchase attempts.
payerYesBase payer wallet address that will authorize the merchant x402 payment.
requestYesExact HTTP request the agent intends to execute after approval; changing it invalidates the authorization binding.
categoryYesService/purchase category evaluated against the AP2 mandate constraints, for example ai-infrastructure.
merchant_idYesStable identifier for the merchant/resource being authorized.
ap2_authorityYesAP2 authority proof for this exact purchase attempt.
payment_requiredYesMerchant's real x402 PAYMENT-REQUIRED payload, either as the decoded object or the original encoded/string form.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed13 schema fields changed
    • addedInput schema / properties / ap2_authority / description
      Added value: +"AP2 authority proof for this exact purchase attempt."
    • addedInput schema / properties / ap2_authority / properties / challenge_token / description
      Added value: +"Short-lived challenge token obtained from create_ap2_challenge and bound into the AP2 proof."
    • addedInput schema / properties / ap2_authority / properties / payment_mandate_chain / description
      Added value: +"AP2 v0.2 SD-JWT/KB-SD-JWT Payment Mandate delegation chain."
    • addedInput schema / properties / ap2_authority / properties / trusted_root_jwks / description
      Added value: +"Trusted P-256 public root JWKs used to verify the AP2 delegation chain."
    • addedInput schema / properties / category / description
      Added value: +"Service/purchase category evaluated against the AP2 mandate constraints, for example ai-infrastructure."
    • addedInput schema / properties / merchant_id / description
      Added value: +"Stable identifier for the merchant/resource being authorized."
    • addedInput schema / properties / nonce / description
      Added value: +"Optional caller nonce for correlation; do not reuse across distinct purchase attempts."
    • addedInput schema / properties / payer / description
      Added value: +"Base payer wallet address that will authorize the merchant x402 payment."
    • addedInput schema / properties / payment_required / description
      Added value: +"Merchant's real x402 PAYMENT-REQUIRED payload, either as the decoded object or the original encoded/string form."
    • addedInput schema / properties / request / description
      Added value: +"Exact HTTP request the agent intends to execute after approval; changing it invalidates the authorization binding."
    • addedInput schema / properties / request / properties / body / description
      Added value: +"Exact request body to bind to the authorization, when present."
    • addedInput schema / properties / request / properties / method / description
      Added value: +"HTTP method of the exact merchant request, for example POST."
    • addedInput schema / properties / request / properties / url / description
      Added value: +"Absolute merchant resource URL that produced the x402 challenge."
  2. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does real work: it discloses the monetary cost ($0.001 via x402), the return value (authorization_token), the binding semantics, and failure behavior ('if authorization is denied, the Trust fee is not settled/charged'). It does not cover auth/signing prerequisites for the payer wallet or any rate limits, so it falls short of a 5.

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?

Front-loaded with the tool's identity and routing position, then cost and failure behavior. Five sentences, all informative, though the ordering instruction is dense enough that it could be tightened slightly.

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 7-parameter, nested-schema, no-output-schema tool, the description supplies the return value, the cost, the failure path, and the surrounding workflow. Error modes other than denial and any signature/auth prerequisites are unstated, so it is strong but not exhaustive.

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 every parameter is already documented in-schema, including the binding warning on `request` and the provenance of `challenge_token`. The description's mention of binding approval to 'the exact merchant challenge and HTTP request' restates what the schema already conveys, so baseline 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?

States a specific verb and resource ('Paid pre-payment trust gate' that 'Verifies AP2 v0.2 authority and binds approval'), and explicitly distinguishes itself from the create_ap2_challenge and verify_settlement siblings by position in the flow. An agent can tell what this does and when it sits relative to other tools without opening any schema.

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

Usage Guidelines5/5

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

Gives an explicit ordered recipe: 'Use after create_ap2_challenge and after receiving the merchant's real x402 PAYMENT-REQUIRED challenge, but before paying the merchant,' then 'next pay the merchant, then call verify_settlement.' The when-not and the alternatives are both named, leaving nothing to inference.

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