Skip to main content
Glama
longbridge

longbridge

Official

Replace Grid Order

grid_replace
DestructiveIdempotent

Replace an existing grid order's rule by ID. Dry-run returns a confirmation code; execute with that code to apply the new rule. Requires explicit user confirmation.

Instructions

Replace an existing grid order's rule by order_id. Accepts the same grid rule fields as grid_submit. Overwrites the order's entire rule. 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 it. The code is derived from the order itself, so it applies only to that exact request. Never quote it back on your own initiative. The dry run echoes the rule that would replace the current one.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rthNoRegular-trading-hours flag: 0 / 1 / 2.
executeNoThe `confirmation_code` from this request'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 it. The code is single use, expires in 10 minutes, and applies only to this exact request — change any field and it stops working. A grid strategy keeps placing orders on its own once live, so never quote the code back on your own initiative.
order_idYesGrid order ID to replace.
expire_timeNoExpiry time in unix seconds (use with GTD).
time_in_forceNoTime in force: 0 = Day, 1 = GTC, 6 = GTD.
multiple_triggerNoWhether one grid level may trigger multiple times.
trigger_quantityNoQuantity per trigger (decimal string).
lower_limit_eventNoAction at lower bound: 1 = ignore (keep running), 2 = close at last price.
lower_limit_priceNoLower price bound (decimal string).
support_shortsellNoWhether short selling is allowed.
trigger_buy_depthNoBuy-side order-book depth (-5..5; 0 = use grid_order_type_down).
trigger_spread_upNoUpward trigger spread, absolute (decimal string; use with type 1).
upper_limit_eventNoAction at upper bound: 1 = ignore (keep running), 2 = close at last price.
upper_limit_priceNoUpper price bound (decimal string).
grid_order_type_upNoSell-side order type when depth is 0: GMO / GLO / GTG.
trigger_percent_upNoUpward trigger percent (decimal string; use with type 2).
trigger_price_typeNoTrigger price type: 1 = spread (absolute), 2 = percent.
trigger_sell_depthNoSell-side order-book depth (-5..5; 0 = use grid_order_type_up).
trigger_spread_downNoDownward trigger spread, absolute (decimal string; use with type 1).
grid_order_type_downNoBuy-side order type when depth is 0: GMO / GLO / GTG.
lower_limit_quantityNoQuantity handled when the lower bound is reached (decimal string).
submitted_base_priceNoBase price the grid is anchored to (decimal string).
trigger_percent_downNoDownward trigger percent (decimal string; use with type 2).
upper_limit_quantityNoQuantity handled when the upper bound is reached (decimal string).

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 request's dry run. WITHOUT IT NOTHING\nIS SENT.\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 it. The code is single use, expires in 10\nminutes, and applies only to this exact request — change any field and\nit stops working. A grid strategy keeps placing orders on its own once\nlive, so never quote the code back on your own initiative.",
      +  "type": "string"
      +}
  2. Addedv0.8.7

TDQS

A4.4/5.0
Behavior5/5

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

The description goes well beyond the annotations by disclosing the dry-run-first behavior, the confirmation_code requirement, the code's single-use and request-scoped nature, and the requirement to wait for explicit user confirmation. It also warns 'Never quote it back on your own initiative,' and its 'Overwrites the order's entire rule' statement aligns with the destructiveHint annotation.

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 compact and front-loaded: it states the action and overwrite semantics first, then the safety protocol. Every sentence carries distinct information, and referencing grid_submit avoids repeating the full field list.

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?

Given the destructive nature and 24 parameters, the description covers the critical behavioral context: dry-run, confirmation_code, user confirmation, and preview echo. However, with no output schema, it does not describe what the final execute call returns on success or failure, and it does not specify which combination of grid rule fields constitutes a valid replacement beyond deferring to grid_submit.

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 coverage is 100%, so the schema already documents all 24 parameters. The description adds a useful cross-reference to grid_submit and clarifies that these fields collectively form the entire replacement rule, but it does not add per-parameter meaning beyond what the schema already provides.

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 concrete action: 'Replace an existing grid order's rule by order_id.' It further clarifies the scope by saying it 'Overwrites the order's entire rule' and references grid_submit for the field set, which distinguishes it from grid management siblings like grid_submit, grid_cancel, and grid_restart.

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 clearly indicates this tool is for an existing grid order identified by order_id, and it provides a mandatory dry-run-and-confirm protocol. It cites grid_submit as the source of rule fields, which helps an agent reuse that knowledge, though it does not explicitly state when to prefer grid_submit for new orders or grid_cancel for cancellation.

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