Skip to main content
Glama
longbridge

longbridge

Official

Replace Order

replace_order
DestructiveIdempotent

Modify an open order's quantity, price, trigger price, or trailing parameters. Preview the change in a dry run, then execute only after user confirmation.

Instructions

Modify an open order's quantity, price, trigger_price, or trailing params. Returns "order replaced" on success. Only open/pending orders can be modified. 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 echoes the current order alongside the requested change.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
priceNoNew limit price (for limit-style orders)
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 replace (returned by submit_order or listed in today_orders / history_orders)
quantityYesNew order quantity (number of shares)
limit_offsetNoNew limit offset from the trailing stop price (for TSLPAMT / TSLPPCT)
trigger_priceNoNew trigger (activation) price (for LIT / MIT / trailing-stop orders)
trailing_amountNoNew trailing amount as absolute price distance (for TSLPAMT)
trailing_percentNoNew trailing percent as decimal e.g. 0.05 = 5% (for TSLPPCT)

Schema Changelog

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

  1. Changed1 schema field 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"
      +}
  2. Changed1 schema field changedv0.7.1
    • removedInput schema / title
      Removed value: -"ReplaceOrderParam"
  3. Addedv0.4.5
  4. Removedv0.4.0
  5. Addedv0.3.2
  6. Removedv0.3.1
  7. First observedv0.1.12

TDQS

A4.5/5.0
Behavior5/5

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

It discloses the most important runtime behavior: calls are dry runs unless a confirmation_code is supplied, nothing reaches the exchange without execute, the code is order-specific, and user confirmation is mandatory before quoting it back. This adds substantial context beyond the annotations and aligns with the destructive/open-world hints; the single-use confirmation model also supports the idempotentHint by preventing duplicate application.

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 front-loads the core purpose and then devotes every sentence to safety-critical protocol. There is no filler or redundancy; the length is justified by the destructive, confirmation-gated behavior.

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 an 8-parameter destructive tool with no output schema, the description covers the success return, the dry-run preview/confirmation_code, the execution condition, and eligibility constraints. The order-type specifics are already in the parameter descriptions, so nothing an agent needs to call it safely 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%, so the schema already documents every parameter's meaning and order-type constraints. The prose adds only a high-level field list and does not amplify or correct the schema, which is the expected baseline.

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 action and scope: 'Modify an open order's quantity, price, trigger_price, or trailing params.' This clearly distinguishes it from submit_order (creation) and cancel_order (deletion), and it does not merely restate the title 'Replace Order.'

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 explicit eligibility constraints ('Only open/pending orders can be modified') and a mandatory dry-run-then-confirm workflow. It does not name alternative tools such as cancel_order or submit_order for cases where replacement is inappropriate, so it stops short of 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