Skip to main content
Glama

Prepare an order (typed data or transaction to sign)

prepare_order
Read-only

No version argument: every order runs on the v4 backend. Which optional arguments apply is decided by the quote that minted the quoteId, so decide before emitting any: a quote that offered a 'bySignature' permit takes permitSignature + permitDeadline once that permit is signed; route:'transaction' applies only to a SwapByTransaction... quote (a native-token sell) and takes no signatures at all. Never send a signature argument unsolicited - it exists to carry back a signature the quote explicitly asked for. Non-custodial: this returns what the user signs, and commits nothing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
routeNoWhich execution route the quote needs, taken from its __typename: 'intent' (default) for everything except SwapByTransaction..., which takes 'transaction' and returns the on-chain transaction plus an orderReceipt, the route a native-token sell takes.
quoteIdYesquoteId from get_swap_quote.
permitDeadlineNoUnix seconds, the 'deadline' from the permit message that was signed. Required with permitSignature.
permitSignatureNoThe user's signature (0x...) over the PermitTypedData a quote's approvals offered under 'bySignature'. Sending it skips the approval transaction. Never send it on a first call - you only have one once a quote has handed you a permit to sign. Requires permitDeadline.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the readOnlyHint and non-destructive annotations, the description reveals that the tool is non-custodial, returns what the user signs, commits nothing, and that optional argument applicability is driven by the originating quote. It also discloses backend version behavior, adding meaningful operational context.

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?

Every sentence carries a distinct and useful rule, and there is no filler. The middle sentence is a long run-on with multiple clauses, which slightly hurts readability, but the key constraints are still front-loaded and precise.

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 prepare-only tool with no output schema, the description covers the major behavioral traps: backend version, quote-driven optional arguments, unsolicited signatures, and non-custodial behavior. It relies on the schema for exact parameter descriptions and route defaults, which is acceptable given 100% schema coverage.

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 adds valuable conditional semantics: permitSignature and permitDeadline are only valid after the quote explicitly offers a bySignature permit, and the transaction route accepts no signatures. This helps an agent decide parameter combinations rather than just reading individual descriptions.

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?

States a specific verb and resource: prepare an order as typed data or a transaction to sign, sourced from a quoteId. It clearly distinguishes the signature-based and transaction-based routes, but it does not explicitly name sibling prepare_* tools to disambiguate from cancel/claim/action preparation.

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?

Gives concrete conditional usage guidance: bySignature permits require permitSignature + permitDeadline, transaction route applies only to SwapByTransaction native-token sells, and signature arguments should never be sent unsolicited. It does not explicitly route to alternatives such as prepare_cancel_order or submit_signed_order, so it stops short of full when-vs-alternatives guidance.

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