Skip to main content
Glama

create_order_draft

Freeze a cart with a delivery address into an order draft and get an approval URL for a person to review totals, choose payment, and pay in the browser; it never places the order.

Instructions

Freeze one of your carts, with a delivery address, into an order draft and get its approval URL. Requires an API key with the orders:write scope. A person opens the URL, checks the frozen lines, address and totals, picks a payment method and pays in the browser — this tool never places the order itself, and any later change to the cart voids the draft. Repeating the call with the same idempotency_key returns the same draft, but the approval URL is shown only on the first, creating call.

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": {
      "cart_id": "<cart_id>",
      "idempotency_key": "<idempotency_key>",
      "address": "<address>"
    },
    "name": "create_order_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
addressYesThe delivery address the order will ship to.
cart_idYesThe cart handle, from `create_cart`.
idempotency_keyYesA caller-chosen key: repeating a create with the same key returns the same draft instead of drafting twice. At most 128 characters.

Output Schema

NameRequiredDescriptionDefault
linesYesThe draft's lines, from its snapshot.
statusYes`pending`, `consumed`, `expired` or `void`.
draft_idYesThe draft's id.
order_idYesThe placed order's id, once the draft is consumed.
total_yenYesGrand total in yen.
expires_atYesWhen the approval window closes, RFC 3339.
approval_urlYesThe browser approval URL (create answer only).
shipping_yenYesShipping fee in yen.
subtotal_yenYesSum of line totals in yen.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full behavioral burden and does so thoroughly: it discloses the auth scope, states the tool never places the order, warns that later cart changes void the draft, and explains idempotency — including the non-obvious detail that the approval URL appears only on the first call.

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

Conciseness5/5

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

Three sentences, each doing distinct work: what it does, who approves and what it never does, and how repeated calls behave. The core action and outcome are front-loaded in the opening clause with no filler.

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?

An output schema exists, so return values need not be spelled out, yet the description still surfaces the key return artifact (the approval URL). For a three-parameter, fully-required mutation, auth, idempotency, invalidation and human-approval semantics are all covered.

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 already 100%, so the baseline is 3. The description earns the extra point by explaining the consequence of idempotency_key (same key returns the same draft, URL only on first call) and framing cart_id and address as the cart-to-draft and ship-to inputs, adding meaning beyond the field-level text.

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 first sentence names a specific verb and resource — freezing a cart into an order draft — and adds the concrete outcome (an approval URL). That distinguishes it clearly from create_cart and get_order_draft, which neither freeze nor produce an approval link.

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

Usage Guidelines4/5

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

It establishes the precondition (a cart plus delivery address), the required orders:write scope, and the hand-off model where a person approves in the browser. It also rules out placing the order, which separates it from a checkout tool. What's missing is an explicit pointer to a sibling for the cases where the agent should not draft, but the context is otherwise unambiguous.

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