Skip to main content
Glama

ap2_verify_cart_mandate

Read-onlyIdempotent

Verifies AP2 CartMandate and IntentMandate envelopes by validating line-item totals, currency exponents, payee binding, TTL, confirmation thresholds, and Ed25519/JCS signatures.

Instructions

Verify A2A AP2 (Agent Payments Protocol) IntentMandate & CartMandate envelopes: validates line-item integer minor-unit sum == total_amount_minor, ISO-4217 & crypto currency exponents (0 JPY/VND, 2 USD/EUR, 3 KWD, 6 USDC, 8 sBTC, 9 SOL, 18 WEI), payee_id binding, TTL expiry, human_confirmation_threshold_minor, and pure-Python RFC 8032 Ed25519 + RFC 8785 JCS signatures.

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": {
      "mandate_json": "<mandate_json>"
    },
    "name": "ap2_verify_cart_mandate"
  }
}

Input Schema

NameRequiredDescriptionDefault
jwks_jsonNoOptional RFC 8037 `OKP` `Ed25519` JWKS object or JSON string.
public_keyNoOptional 32-byte Ed25519 public key (hex, base64, or base64url) for signature verification.
mandate_jsonYesAP2 `CartMandate` or `IntentMandate` JSON object, JSON string, or base64url string.
expected_payee_idNoOptional merchant/agent `payee_id` that must match the mandate.
reference_unix_tsNoOptional deterministic Unix timestamp for TTL expiry checks.
require_signatureNoRequire a verified RFC 8032 Ed25519 + RFC 8785 JCS signature (`True` by default).
intent_mandate_jsonNoOptional parent `IntentMandate` object or JSON string to cross-check cap, currency, and payee.
human_confirmation_threshold_minorNoOptional integer minor-unit threshold requiring `human_confirmed=True` when exceeded.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive, and closed-world behavior. The description adds substantial behavioral detail by enumerating the exact validations performed—line-item sum, currency exponents, payee binding, TTL, confirmation threshold, and Ed25519/JCS signatures—which goes well beyond the safety hints. It does not disclose what a failed verification returns or how errors are surfaced, keeping it from 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?

The description is a single dense sentence that front-loads the verb and resources before listing validations, with no filler. It is information-rich but borders on overpacked for readability, so not a 5.

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

Completeness3/5

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

The tool is complex (8 parameters, cryptographic checks) and has no output schema, so the description should ideally state what a successful or failed verification returns. It thoroughly covers the checks performed and the schema covers inputs, but the lack of return-value or error-shape disclosure leaves a meaningful gap for an agent invoking it.

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 coverage is 100%, so every parameter is already documented in the input schema. The description reinforces the meaning of validation-related fields like total_amount_minor, payee_id, TTL expiry, and human_confirmation_threshold_minor, but adds little parameter-level syntax beyond what the schema provides; the currency exponent list is domain context rather than parameter semantics.

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

Purpose4/5

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

The description opens with a specific verb, 'Verify', and names the exact resource types ('IntentMandate' & 'CartMandate' envelopes), so the agent knows precisely what operation is performed. It does not explicitly differentiate itself from the sibling x402 tools, though they are a different protocol family, so it falls short of a 5.

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

Usage Guidelines3/5

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

Usage is implied by the validation list: the tool is for checking AP2 mandate integrity and signatures. There is no explicit when-to-use or when-not-to-use guidance, nor are any alternatives named, leaving the agent to infer that this is the AP2 verification entry point.

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