Skip to main content
Glama

AP2 mandate check

wever_ap2-mandate-check
Read-only

Agent preflight: verify an AP2 mandate before anything is committed. Send the mandate as presented in presentation: an AP2 v0.2 SD-JWT carrying a closed checkout mandate, a closed payment mandate or both, or one open mandate (human not present), or the AP2 gateway presentation (issuer JWT~holder binding); optionally the closed payment mandate in payment_presentation, the gateway challenge_token, public keys (the issuer key and, for a closed checkout, the merchant key) or trusted_profile for the anchors the AP2 gateway contract publishes, and the context to read it against: read_at, the amount, payee, merchant and items of the payment or checkout, the amount spent and payments made under an open mandate, and the presenter wallet, audience and nonce for the holder binding. The signed report reads the structure against the AP2 v0.2 profile the credential claims, every required claim present; the signature against the key material, naming the key that signed by thumbprint; for a closed pair, the payment mandate transaction_id against the checkout mandate hash; whether the mandate is in force at the read time, with the window left; each constraint against the presented payment (amount range, total budget, payee or merchant set, item scope, recurrence) as holding, violated or not stated by the mandate; and, where the presentation carries holder proof, whether the presenter is bound as holder, read the way the gateway reads it. Every failed or unstated item is named with its fix. It reads only the material in the call and the published AP2 profile: it makes no network call, contacts no issuer, checks no revocation (AP2 v0.2 documents no revocation path for open mandates, and the report says so for an open mandate), moves no money, consumes nothing and records no presentation, and its result never authorizes a payment by itself. wever_ap2-mandate-gateway is the stateful gate that verifies a closed gateway mandate and consumes it once; this check reads both AP2 profiles before that, consuming nothing. wever_negotiation-mandate-check reads a negotiation mandate document, wever_mandate-issue and its siblings run the Wever trading mandate, wever_payment-policy-check reads an x402 challenge against a spending policy, wever_delegation-check reads a delegation document for scope and caps, and wever_x402-payment-gateway reads a payment signature and chain state. A worked sample is wever_ap2-mandate-sample on https://weverlabs.com/mcp-free. POST /api/ap2-mandate-check. Verdict ap2_mandate_fails, ap2_mandate_gaps, ap2_mandate_unverified or ap2_mandate_holds. Paid URL: 0.10 USDC per call on Base via x402 exact, with the shared 10 signed-wallet free calls per rolling 30 days. Bind X-Wever-Wallet-Proof to the exact JSON arguments and the tool route. Returns a report with an Ed25519 signed receipt. Contract: /api/ap2-mandate-check-contract. Human page: https://weverlabs.com/preflight/.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "presentation": "<presentation>"
    },
    "name": "wever_ap2-mandate-check"
  }
}

Input Schema

NameRequiredDescriptionDefault
keysNoIssuer and merchant public JWKs.
labelNo
contextNoWhat to read the mandate against; amounts in minor units.
presentationYesAn AP2 v0.2 SD-JWT as presented, or the AP2 gateway issuer JWT~holder binding.
challenge_tokenNoGateway challenge token.
trusted_profileNo
payment_presentationNoA closed payment mandate sent apart.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, openWorldHint=false, and the description reinforces the closed-world claim ('makes no network call, contacts no issuer') while adding what annotations cannot: no revocation path exists for open mandates and the report says so, the result never authorizes a payment, nothing is consumed or recorded, and output is an Ed25519 signed receipt. It even lists the four verdict strings, which is genuine behavioral detail beyond the structured fields. Minor gap: it does not explain why the tool is marked non-idempotent despite consuming nothing.

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

Conciseness3/5

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

The opening line is well front-loaded, but the body is built from 100-plus-word run-on sentences that chain ten or more clauses with commas and slashes, making it hard to scan under time pressure. The operational tail (paid URL, pricing, wallet-proof header, contract link, human page) is useful but further inflates length, and some of the report-field enumeration could be tightened.

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

Completeness5/5

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

For a complex, seven-parameter verification tool with nested context and no output schema, the description covers what is checked (profile conformance, signature and signing key thumbprint, checkout/payment transaction_id binding, mandate validity window, each constraint as holding/violated/not stated, holder binding), what the verdicts are, and what the receipt provides. An agent has enough to decide and call correctly.

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 71%, and the description compensates well: it distinguishes the accepted presentation forms (closed checkout, closed payment, single open mandate, or gateway issuer JWT~holder binding) and enumerates what context is read against (read_at, amount, payee, merchant, items, spent_to_date, occurrences, wallet, audience, nonce, plus keys/trusted_profile/challenge_token). It leaves the top-level 'label' parameter unmentioned and parses formats as a dense clause list rather than per-field, so it adds meaning but not exhaustively.

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 — verify an AP2 mandate as an agent preflight — and immediately bounds the scope: reads both AP2 profiles, consumes nothing, moves no money. It explicitly marks itself as the stateless pre-check relative to wever_ap2-mandate-gateway, so an agent can distinguish the two without opening either 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 when/when-not: use this before the stateful gateway ('reads both AP2 profiles before that, consuming nothing'), while wever_ap2-mandate-gateway verifies a closed gateway mandate and consumes it once. It also routes to the correct sibling for adjacent jobs (negotiation mandate, issuance, x402 policy, delegation, x402 gateway), 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