Skip to main content
Glama

Build the unsigned transactions for a trade

qmax_build_plan
Read-onlyIdempotent

Quotes an order and returns the exact transactions a wallet must sign to carry it out, in order. QMax signs nothing and sends nothing: you (or the user) sign each step with your own wallet and broadcast it.

Steps (in order): any share-management move needed first (selling shares that the other market manages), then one call per market. Each step: kind, description, destination (a smart contract by index), inputType (procedure number), amountQu to attach (QU that may leave the wallet; unused QU is refunded by the contracts) and payloadBase64 (the call's input bytes). 'maxOutlayQu' is the most QU that can leave the wallet across all steps, so it is the figure to compare with a spending limit before signing. Signing and sending a step moves real funds.

For a sell, pass how many shares the wallet holds under QX management and under QSwap management (holdings_qx, holdings_qswap) so the right moves are planned. Buys need no holdings.

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": {
      "side": "<side>",
      "asset": "<asset>",
      "qty": "<qty>"
    },
    "name": "qmax_build_plan"
  }
}

Input Schema

NameRequiredDescriptionDefault
qtyYesHow many units of the asset
sideYesWhether the order buys or sells the asset (a buy spends QU, a sell receives QU)
assetYesAsset symbol, for example CFB or QDOGE (case does not matter). qmax_list_assets lists the tradable symbols.
holdings_qxNoSelling only: units of this asset the wallet holds that QX manages
slippage_bpsNoSlippage tolerance in basis points (100 = 1%), applied to the limits in each step
holdings_qswapNoSelling only: units of this asset the wallet holds that QSwap manages

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / qty / description
      Added value: +"How many units of the asset"
    • addedInput schema / properties / side / description
      Added value: +"Whether the order buys or sells the asset (a buy spends QU, a sell receives QU)"
    • addedInput schema / properties / slippage_bps / description
      Added value: +"Slippage tolerance in basis points (100 = 1%), applied to the limits in each step"
  2. Changed1 schema field changed
    • changedInput schema / properties / asset / description
      Previous value: -"Asset symbol, for example CFB or QDOGE (case does not matter). Use qmax_list_assets to find one."New value: +"Asset symbol, for example CFB or QDOGE (case does not matter). qmax_list_assets lists the tradable symbols."
  3. First observed

TDQS

A4.7/5.0
Behavior5/5

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

It adds substantial behavior beyond annotations: QMax itself signs nothing and sends nothing, the plan is ordered, each step includes destination/inputType/amountQu/payloadBase64, unused QU is refunded, maxOutlayQu is the spending-limit comparison figure, and signing does move real funds. This is exactly the kind of safety and sequencing context an agent needs for a transaction-building tool.

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?

The description is front-loaded with the core purpose, then structured into step semantics and sell-specific parameter guidance. Despite covering many details, every paragraph serves selection, invocation, or safety understanding.

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?

There is no output schema, so the description carries the burden of explaining the return shape, and it does so by describing the ordered steps and each step's fields. Combined with the spending-limit note and the sell-holdings guidance, it provides enough context for an agent to call and interpret the tool safely.

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 schema already documents all six parameters. The description still adds useful conditional semantics by explaining that sell orders need holdings_qx and holdings_qswap so the right share moves are planned, and that buys need no holdings.

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 states a specific verb and resource: it quotes an order and returns the exact unsigned transactions a wallet must sign, in order. This clearly distinguishes it from pure quote/inspection siblings like qmax_get_quote without needing to name them, because the output is executable transaction steps rather than just a price.

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?

The description gives clear usage context: it is the tool for planning the actual transactions to sign and broadcast, and it explains that sells require holdings_qx and holdings_qswap while buys do not. It stops short of explicitly naming when to use a simpler quote sibling instead, so it is clear but not fully alternative-routing.

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.