Skip to main content
Glama

撤单

build_cancel_orders
Read-only

撤销未成交的委托(限价单、止盈止损,以及 status=expired 的过期市价单),一次可撤多张;保证金和剩余执行费退回钱包。订单 key 从 get_account 的 orders 获取。发送时按 step 里的 gasLimitHint 设 gas 上限。

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": {
      "account": "<account>",
      "keys": "<keys>"
    },
    "name": "build_cancel_orders"
  }
}

Input Schema

NameRequiredDescriptionDefault
keysYes要撤销的订单 key 列表(0x 开头的 64 位十六进制,从 get_account 的 orders 获取)
agentNoagent 专用通道:填 agent 自己的钱包地址后,交易由 agent 用自己的私钥直接签名发送,不用用户逐笔确认(用户需先用 build_agent_authorize 授权这个地址)。不填则由用户钱包签名
accountYes用户钱包地址(交易的签名人和收款人)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / keys / description
      Added value: +"要撤销的订单 key 列表(0x 开头的 64 位十六进制,从 get_account 的 orders 获取)"
  2. Changed2 schema fields changed
    • removedInput schema / properties / keys / items / pattern
      Removed value: -"^0x[0-9a-fA-F]{64}$"
    • removedInput schema / properties / keys / items / type
      Removed value: -"string"
  3. First observed

TDQS

A3.9/5.0
Behavior3/5

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

The annotations already declare readOnlyHint=true, destructiveHint=false and idempotentHint=false, so the safety profile is covered; the description adds real value by disclosing the side effect (margin and remaining execution fee returned to the wallet) and the gas-limit instruction. However, it never reconciles the read-only annotation with the described cancellation effect — it does not state whether the tool merely builds an unsigned transaction/step or actually submits it, which is the single most consequential behavioral fact here. It also says nothing about partially filled orders or failure modes.

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?

Three compact clauses, front-loaded with purpose, then effects, then prerequisites/next-step instructions — no filler. It is dense but every clause carries operational information; a slightly clearer separation of 'what it returns' would improve structure.

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 3-parameter tool with no output schema, the description covers the essentials: what gets cancelled, what gets refunded, where keys come from, and that a step with gasLimitHint is produced. The main residual gap is the build-vs-send contract and what the returned step requires from the caller, which an agent would still have to infer.

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 description coverage is 100%, so all three parameters (keys, agent, account) are already documented in the schema, including the agent authorization prerequisite. The description only reinforces where keys come from and adds the gas hint, which pertains to the returned step rather than to any parameter. Baseline 3 is appropriate when the schema carries the parameter burden.

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 (撤销未成交的委托) and then enumerates exactly which order types are eligible (限价单、止盈止损、status=expired 的过期市价单), plus that it is batch-capable. That level of specificity lets an agent distinguish it from siblings like build_set_tp_sl or build_close_position without opening any schema.

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 gives concrete pre-call guidance: order keys come from get_account's orders, and gas limit should be set from the step's gasLimitHint. The eligible-order-type list also acts as an implicit boundary on when this tool applies. It stops short of naming an alternative or stating exclusions (e.g. what to do for filled orders), so it is clear context rather than full when/when-not 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.

Resources