Skip to main content
Glama

撤单

build_cancel_orders
Read-only

Cancels multiple unfilled limit, TP/SL, or expired market orders in one request, returning margin and unused execution fees to the wallet; order keys come from get_account.

Instructions

撤销未成交的委托(限价单、止盈止损,以及 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
agentNoagent 专用通道:填 agent 自己的钱包地址后,交易由 agent 用自己的私钥直接签名发送,不用用户逐笔确认(用户需先用 build_agent_authorize 授权这个地址)。不填则由用户钱包签名
accountYes用户钱包地址(交易的签名人和收款人)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior1/5

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

The description explicitly says margin and remaining execution fees are refunded to the wallet and that orders are cancelled — a state-changing write. Annotations declare readOnlyHint=true and destructiveHint=false, which directly contradicts this. IdempotentHint=false is consistent, but the read-only claim conflicts with the described behavior.

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 dense sentences, front-loaded with the action and scope, then eligibility, then key sourcing and gas setup. No filler.

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?

No output schema, and the description hints the response contains a `step` with gasLimitHint, plus reports the refund effect. Combined with schema-described agent/account, an agent has enough to invoke correctly; only the exact response shape remains implicit.

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 67%, and the description adds real meaning: it tells the agent where `keys` values come from (get_account's orders) and that multiple can be passed in one call. It does not clarify the `account` or `agent` parameters beyond the schema, which already describes agent well.

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?

States a specific verb (撤销) and resource (未成交的委托) and even enumerates which order types qualify (限价单、止盈止损, status=expired 市价单) plus batch capability. An agent knows exactly what this tool does without opening the 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?

Gives actionable prerequisites: order keys come from get_account's orders, and gas limit should be set from step.gasLimitHint at send time. It does not spell out when not to use it (e.g. already-filled orders), but no cancel alternative exists among siblings, so the guidance is largely sufficient.

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