Skip to main content
Glama

Attach the receipt to the order

attach_order

Call this right after placing an order you checked with check_cart_before_checkout, validate_purchase_plan or check_compatibility: link the receipt_id to the order number, AP2 cart or intent mandate, ACP checkout session, UCP checkout or payment reference. This makes a Decision Record: if the purchase is ever disputed ("the agent bought the wrong thing"), anyone can show what was checked, from which sources, and what changed since. Free.

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": {
      "receipt_id": "<receipt_id>"
    },
    "name": "attach_order"
  }
}

Input Schema

NameRequiredDescriptionDefault
merchantNoMerchant name or domain.
order_idNoThe merchant's order number.
receipt_idYesThe receipt id (rcpt_...) from the check, plan or checkout check made before buying.
ucp_checkoutNoUCP checkout id.
ap2_cart_mandateNoAP2 cart mandate hash or id, if the purchase used AP2.
payment_referenceNoPayment or transaction reference.
ap2_intent_mandateNoAP2 intent mandate hash or id.
acp_checkout_sessionNoACP checkout session id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -{
      -  "type": "object"
      -}New value: +null
  2. Added

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already disclose that this is a non-read-only, non-destructive, non-idempotent, closed-world mutation, so the description needn't repeat that. It adds real value by explaining the outcome ('This makes a Decision Record') and its dispute-defense purpose, plus the cost ('Free'). The one gap is that it never warns that idempotentHint=false means repeated calls can create duplicate records, nor what happens with an invalid receipt_id.

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?

It is front-loaded with the action and timing, then justifies itself with the Decision Record rationale, so no sentence is filler. The middle sentence is dense with comma-separated identifiers and the parenthetical quote is slightly chatty, costing a point on tightness.

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 an 8-parameter mutation with no output schema and full annotation coverage, the description supplies purpose, prerequisites, the set of linkable identifiers and the business payoff. What's missing is any indication of what the call returns (e.g., a decision/record id) or how to handle re-invocation, which matters given non-idempotency.

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%, so the baseline is 3, but the description goes further by mapping optional identifiers to protocols (AP2 purchases use cart/intent mandate, ACP uses a checkout session), which the flat schema does not convey. It also clarifies that receipt_id comes from the prior check/plan/checkout call.

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 gives a concrete action ('link the receipt_id to the order number') plus the full set of identifiers it can bind together (AP2 cart/intent mandate, ACP checkout session, UCP checkout, payment reference). It also names the three sibling check tools that precede it, so an agent can separate this write-back step from the pre-purchase checks. The title alone is vaguer, but the body removes any ambiguity.

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?

It states explicit timing ('Call this right after placing an order') and conditions the call on having used check_cart_before_checkout, validate_purchase_plan or check_compatibility, which is effectively a prerequisite gate. It doesn't enumerate a when-not-to-use case, but the sequencing rule plus the named alternatives leaves little to infer.

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