Skip to main content
Glama
longbridge

longbridge

Official

Cancel Order

cancel_order
DestructiveIdempotent

Cancel an open order by its ID using a two-step confirmation. Preview the order first, then confirm with the returned code to execute the cancellation.

Instructions

Cancel an open order by order_id. Returns plain text "order cancelled" on success; errors if the order is already filled or cancelled. TWO-STEP CONFIRMATION IS MANDATORY: this tool is a DRY RUN unless you pass the confirmation_code its own dry run returned. Call it first without execute, show the returned preview to the user, and only call it again with execute="" after the user has explicitly confirmed that exact order. The code is derived from the order itself, so it applies only to that exact order. Never quote it back on your own initiative, and never in the same turn the user first asks. The dry run also echoes the order being targeted so the user can verify it is the right one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
executeNoThe `confirmation_code` from this order's dry run. WITHOUT IT NOTHING IS SENT. Omitted (the default) makes this a DRY RUN: the request is validated and echoed back with a three-digit `confirmation_code`, and nothing reaches the exchange. Required protocol: call once without `execute`, show the returned preview to the user, and call again quoting the code only after the user has explicitly confirmed that exact order. The code is single use, expires in 10 minutes, and applies only to this exact order — change any field and it stops working. Never quote it back on your own initiative, and never in the same turn the user first asks.
order_idYesOrder ID to cancel (from today's orders or order history)

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv0.10.2
    • addedInput schema / properties / execute
      Added value: +{
      +  "description": "The `confirmation_code` from this order's dry run. WITHOUT IT NOTHING IS\nSENT.\n\nOmitted (the default) makes this a DRY RUN: the request is validated and\nechoed back with a three-digit `confirmation_code`, and nothing reaches\nthe exchange.\n\nRequired protocol: call once without `execute`, show the returned\npreview to the user, and call again quoting the code only after the user\nhas explicitly confirmed that exact order. The code is single use,\nexpires in 10 minutes, and applies only to this exact order — change any\nfield and it stops working. Never quote it back on your own initiative,\nand never in the same turn the user first asks.",
      +  "type": "string"
      +}
    • changedInput schema / properties / order_id / description
      Previous value: -"Order ID (from today's orders or order history)"New value: +"Order ID to cancel (from today's orders or order history)"
  2. Changed1 schema field changedv0.8.7
    • changedInput schema / properties / order_id / description
      Previous value: -"Order ID (returned by submit_order or listed in today_orders / history_orders)"New value: +"Order ID (from today's orders or order history)"
  3. Changed1 schema field changedv0.7.1
    • removedInput schema / title
      Removed value: -"OrderIdParam"
  4. Addedv0.4.5
  5. Removedv0.4.0
  6. Addedv0.3.2
  7. Removedv0.3.1
  8. First observedv0.1.12

TDQS

A4.4/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=true, idempotentHint=true), the description discloses crucial behavioral traits: dry-run-vs-execute semantics, the mandatory two-step confirmation flow, the code being derived from and bound to the exact order, the single-use nature, the never-quote-back rule, and the return format. This substantially enriches what the annotations alone convey and aligns with them — no contradiction with destructiveHint=true or idempotentHint=true.

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?

The description is longer than average but the length is justified for a destructive tool with a mandatory confirmation flow. It is front-loaded with purpose and return behavior before diving into the safety protocol. Minor redundancy exists ("derived from the order" and "applies only to that exact order" say nearly the same thing; "never in the same turn the user first asks" partially overlaps with "after the user has explicitly confirmed"), but no sentence is wasted.

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?

For a high-complexity destructive tool with no output schema, the description covers everything an agent needs: success return value, error conditions, the exact call sequence, the confirmation-code constraints, and how the user can verify the targeted order. Nothing essential for correct invocation is missing.

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%, and the schema's execute parameter already documents the full confirmation protocol including 10-minute expiry and single-use behavior. The description reinforces this content but does not meaningfully add beyond the structured schema, so the baseline 3 applies.

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 opens with a specific verb+resource statement — "Cancel an open order by order_id" — that precisely identifies the action, the target, and the required identifier. The scope (open orders only) plus the error-on-filled/cancelled clause clearly differentiates it from siblings like submit_order, replace_order, and grid_cancel without needing to name them.

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 provides unusually explicit procedural guidance: call once without execute for a dry run, show the preview to the user, then call again with execute only after explicit confirmation. The "errors if the order is already filled or cancelled" clause is an implicit when-not condition. However, no sibling alternatives are explicitly named (e.g., pointing to replace_order when modification rather than cancellation is wanted), so it stops just short of a 5.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/longbridge/longbridge-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server