Skip to main content
Glama
longbridge

longbridge

Official

Submit Grid Order

grid_submit

Submit a grid trading order after a dry-run preview; re-call with the returned confirmation code to execute only after user approval.

Instructions

Submit a grid trading order. DRY RUN unless execute is the confirmation_code from its own dry run: call once without execute, show the preview, then re-call quoting the code only after the user confirms.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
_jqNoOptional jq filter (jaq syntax) applied to this tool's JSON response before it is returned; it never changes the upstream request. One output is returned as-is, several as a JSON array, none as []. Module imports and the `env`/`debug`/`stderr` builtins are unavailable. Example: .data | map({symbol}). Omit for the full response.
rthNoRegular-trading-hours flag: 0 / 1 / 2.
symbolYesSecurity symbol, e.g. "700.HK".
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.
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).
settlement_currencyYesSettlement currency, e.g. "HKD".
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.

  1. Changed9 schema fields changedv0.12.0
    • addedInput schema / properties / _jq / description
      Added value: +"Optional jq filter (jaq syntax) applied to this tool's JSON response before it is returned; it never changes the upstream request. One output is returned as-is, several as a JSON array, none as []. Module imports and the `env`/`debug`/`stderr` builtins are unavailable. Example: .data | map({symbol}). Omit for the full response."
    • removedInput schema / properties / expire_time / format
      Removed value: -"int64"
    • removedInput schema / properties / lower_limit_event / format
      Removed value: -"int32"
    • removedInput schema / properties / rth / format
      Removed value: -"int32"
    • removedInput schema / properties / time_in_force / format
      Removed value: -"int32"
    • removedInput schema / properties / trigger_buy_depth / format
      Removed value: -"int32"
    • removedInput schema / properties / trigger_price_type / format
      Removed value: -"int32"
    • removedInput schema / properties / trigger_sell_depth / format
      Removed value: -"int32"
    • removedInput schema / properties / upper_limit_event / format
      Removed value: -"int32"
  2. Changed2 schema fields changedv0.10.6
    • addedInput schema / properties / _jq
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "dry_run": {
      -      "type": "boolean"
      -    },
      -    "next_step": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "order_id": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "preview": {}
      -  },
      -  "required": [
      -    "dry_run"
      -  ],
      -  "type": "object"
      -}New value: +null
  3. Changed6 schema fields 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"
      +}
    • addedOutput schema / properties / dry_run
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / next_step
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / order_id / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / preview
      Added value: +{}
    • changedOutput schema / required
      Previous value: -[
      -  "order_id"
      -]New value: +[
      +  "dry_run"
      +]
  4. Addedv0.8.7

TDQS

A4.6/5.0
Behavior5/5

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

The description discloses the dry-run mechanism, confirmation code single-use, 10-minute expiry, and the fact that the grid operates autonomously once live. These are behavioral traits not present in annotations (readOnlyHint false, openWorldHint true, idempotentHint false), adding substantial value beyond structured fields.

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?

Two sentences with no fluff. The critical dry-run warning is front-loaded, and the protocol is stated concisely. Every sentence earns its place.

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 26-parameter tool with no output schema, the description covers the essential execution flow and the schema covers parameter details. It mentions showing a preview, implying a return value, and includes the key caveat about autonomous grid behavior. Minor gaps (exact response format) are acceptable given the schema's thoroughness.

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 26 parameters. The description adds context on the execute parameter's role, but the schema already explains the confirmation-code protocol in detail. The description does not introduce new parameter semantics beyond what the schema 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?

Description clearly states the action (submit a grid trading order) and the crucial dry-run/execute flow. It distinguishes from siblings like grid_replace and grid_cancel by focusing on the submission and the two-step protocol.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly instructs to call once without execute, show the preview, then re-call only after user confirmation. It also warns against quoting the code autonomously because the grid keeps placing orders. This leaves no ambiguity about when and how to use the tool.

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

Deploy Server

Other Tools