Skip to main content
Glama

AI Source of Truth Evidence Rooms

AP2 pay

ap2_submit_payment_mandate

Present a checkout mandate and a payment mandate (SD-JWTs signed with the org's registered mandate key) and settle by credits, card or x402. Answers with signed receipts. Scope: billing:write. REST twin: POST /api/ap2/orgs/:org/payments. Errors: unauthorized, insufficient_scope, not_found, forbidden, validation_error, signature_invalid, conflict, payment_required.

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": {
      "org_id": "<org_id>",
      "checkout_mandate": "<checkout_mandate>",
      "payment_mandate": "<payment_mandate>"
    },
    "name": "ap2_submit_payment_mandate"
  }
}

Input Schema

NameRequiredDescriptionDefault
org_idYes
payment_mandateYes
checkout_mandateYes
payment_credentialNocard: {"type":"card","token":"pm_..."}; x402: {"type":"x402","payload":"<base64 X-PAYMENT>"}; credits: omit.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=false and openWorldHint=false, so the description does real work: it discloses that mandates must be SD-JWTs signed with the org's registered mandate key, that settlement moves credits/card/x402 funds, that the response is signed receipts, and it lists failure modes including signature_invalid, conflict and payment_required. It stops short of stating idempotency or whether a failed settlement rolls back, which are the remaining gaps for a money-moving call.

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 core action and its inputs are front-loaded in the first sentence, followed by scope, endpoint and error taxonomy in a compact telegraphic style. The long error list costs some space but each entry is actionable; the fragment style is efficient rather than padded.

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 mutating financial tool with no output schema, the description still covers the return ('signed receipts'), auth scope, endpoint twin and error surface, which is enough to invoke it correctly. Missing are mandate acquisition/format details and retry-after-conflict semantics, which an agent would likely need on failure paths.

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 only 25%, and the description adds real meaning for two of the four parameters by explaining that the mandates are signed SD-JWTs and by enumerating the card/x402/credits settlement modes that map to payment_credential. However, org_id and the concrete credential shapes it alludes to are left to the schema, so the coverage gap is only partly compensated.

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 names a specific verb and resource (present checkout + payment mandates, settle by credits/card/x402) and adds the REST twin POST /api/ap2/orgs/:org/payments, which pins the operation unambiguously. The sibling set is mostly read/lookup tools (ap2_get_cart, ap2_get_catalog), so no explicit differentiation is needed for an agent to see this is the settlement call.

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?

It supplies the required scope (billing:write) and enumerates settlement channels, which implies when this applies, but never states prerequisites such as where the mandates come from or that ap2_get_cart should precede it. No explicit when-not or alternative routing is given.

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