Skip to main content
Glama
longbridge

longbridge

Official

Submit Order

submit_order
Destructive

Submit buy/sell orders to US/HK exchanges with a dry-run preview that requires explicit user confirmation before any order is placed.

Instructions

Submit a buy/sell order. DRY RUN unless execute is the confirmation_code from its own dry run: call once without execute, show the preview to the user, then re-call quoting the code only after they explicitly confirm.

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.
sideYesBuy or Sell
remarkNoOrder remark (max 255 characters)
symbolYesSecurity symbol, e.g. "700.HK". Use the canonical form — a padded code like "00700.HK" returns an empty record, not an error.
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_typeYesOrder type (HK supports all; US supports LO/MO/LIT/MIT/TSLPAMT/TSLPPCT only): - LO (Limit Order): requires submitted_price - ELO (Enhanced Limit Order, HK only): requires submitted_price - MO (Market Order): no price required - AO (At-auction Order, HK only): executed at auction price, no price required - ALO (At-auction Limit Order, HK only): requires submitted_price - ODD (Odd Lots Order, HK only): requires submitted_price, for non-standard lot sizes - LIT (Limit If Touched): requires submitted_price and trigger_price; activates when market price touches trigger_price - MIT (Market If Touched): requires trigger_price only; executes at market when trigger_price is touched - TSLPAMT (Trailing Limit If Touched by Amount): requires trailing_amount and limit_offset; trailing stop by fixed amount - TSLPPCT (Trailing Limit If Touched by Percent): requires trailing_percent (0-1) and limit_offset; trailing stop by percentage - SLO (Special Limit Order, HK only): requires submitted_price; cannot be replaced after submission
expire_dateNoExpiry date (yyyy-mm-dd). Required when time_in_force is GTD
outside_rthNoOutside regular trading hours: "RTH_ONLY" (regular trading hours only), "ANY_TIME" (any time including pre/post market), "OVERNIGHT" (overnight session, US only), "OPTION_PRE_MARKET" (US option pre-market session)
limit_offsetNoLimit offset from the trailing stop price. Required for: TSLPAMT, TSLPPCT
time_in_forceYesOrder validity: "Day" (Day Order, expires end of session), "GTC" (Good Til Canceled), "GTD" (Good Til Date, requires expire_date)
trigger_priceNoTrigger (activation) price. Required for: LIT, MIT, TSLPAMT, TSLPPCT
submitted_priceNoLimit price. Required for: LO, ELO, ALO, ODD, LIT, SLO
trailing_amountNoTrailing amount (absolute price distance). Required for TSLPAMT
trailing_percentNoTrailing percent as decimal (e.g. 0.05 = 5%). Required for TSLPPCT
client_request_idNoIdempotency key, unique per intended order (e.g. a UUID). When two requests carry the same value the exchange places one order and returns the original `order_id` for the second, so a retry after a timeout or a dropped connection cannot double-fill. Set it whenever you may retry; generate a NEW value for a genuinely new order.
submitted_quantityYesOrder quantity (number of shares)
attached_order_typeNoAttach a take-profit / stop-loss leg to this order: "PROFIT_TAKER" (take-profit only), "STOP_LOSS" (stop-loss only) or "BRACKET" (both). Omit for a plain order; every other attached_* field is ignored without it.
attached_expire_timeNoExpiry of the attached leg as a unix timestamp in seconds (e.g. "1767139200"). Required when attached_time_in_force is GTD.
attached_outside_rthNoOutside-RTH setting of the triggered leg: "RTH_ONLY" / "ANY_TIME" / "OVERNIGHT" / "OPTION_PRE_MARKET".
attached_time_in_forceNoTime-in-force of the attached leg: "Day" / "GTC" / "GTD". Defaults to the parent order's setting when omitted.
attached_stop_loss_priceNoStop-loss trigger price. Required for STOP_LOSS and BRACKET.
attached_profit_taker_priceNoTake-profit trigger price. Required for PROFIT_TAKER and BRACKET.
attached_activate_order_typeNoOrder type the attached leg is submitted as once triggered, e.g. "LO" (then set the matching attached_*_submit_price) or "MO".
attached_stop_loss_submit_priceNoLimit price of the stop-loss leg, for an LO attached_activate_order_type.
attached_profit_taker_submit_priceNoLimit price of the take-profit leg, for an LO attached_activate_order_type.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 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."
    • changedInput schema / properties / attached_outside_rth / description
      Previous value: -"Outside-RTH setting of the triggered leg: \"RTH_ONLY\" / \"ANY_TIME\" /\n\"OVERNIGHT\"."New value: +"Outside-RTH setting of the triggered leg: \"RTH_ONLY\" / \"ANY_TIME\" /\n\"OVERNIGHT\" / \"OPTION_PRE_MARKET\"."
    • addedInput schema / properties / client_request_id
      Added value: +{
      +  "description": "Idempotency key, unique per intended order (e.g. a UUID). When two\nrequests carry the same value the exchange places one order and returns\nthe original `order_id` for the second, so a retry after a timeout or a\ndropped connection cannot double-fill. Set it whenever you may retry;\ngenerate a NEW value for a genuinely new order.",
      +  "type": "string"
      +}
    • changedInput schema / properties / outside_rth / description
      Previous value: -"Outside regular trading hours: \"RTH_ONLY\" (regular trading hours only), \"ANY_TIME\" (any time including pre/post market), \"OVERNIGHT\" (overnight session, US only)"New value: +"Outside regular trading hours: \"RTH_ONLY\" (regular trading hours only), \"ANY_TIME\" (any time including pre/post market), \"OVERNIGHT\" (overnight session, US only), \"OPTION_PRE_MARKET\" (US option pre-market session)"
    • changedInput schema / properties / symbol / description
      Previous value: -"Security symbol, e.g. \"700.HK\""New value: +"Security symbol, e.g. \"700.HK\". Use the canonical form — a padded code like \"00700.HK\" returns an empty record, not an error."
  2. Changed11 schema fields changedv0.10.6
    • addedInput schema / properties / _jq
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / attached_activate_order_type
      Added value: +{
      +  "description": "Order type the attached leg is submitted as once triggered, e.g. \"LO\"\n(then set the matching attached_*_submit_price) or \"MO\".",
      +  "type": "string"
      +}
    • addedInput schema / properties / attached_expire_time
      Added value: +{
      +  "description": "Expiry of the attached leg as a unix timestamp in seconds (e.g.\n\"1767139200\"). Required when attached_time_in_force is GTD.",
      +  "type": "string"
      +}
    • addedInput schema / properties / attached_order_type
      Added value: +{
      +  "description": "Attach a take-profit / stop-loss leg to this order: \"PROFIT_TAKER\"\n(take-profit only), \"STOP_LOSS\" (stop-loss only) or \"BRACKET\" (both).\nOmit for a plain order; every other attached_* field is ignored without\nit.",
      +  "type": "string"
      +}
    • addedInput schema / properties / attached_outside_rth
      Added value: +{
      +  "description": "Outside-RTH setting of the triggered leg: \"RTH_ONLY\" / \"ANY_TIME\" /\n\"OVERNIGHT\".",
      +  "type": "string"
      +}
    • addedInput schema / properties / attached_profit_taker_price
      Added value: +{
      +  "description": "Take-profit trigger price. Required for PROFIT_TAKER and BRACKET.",
      +  "type": "string"
      +}
    • addedInput schema / properties / attached_profit_taker_submit_price
      Added value: +{
      +  "description": "Limit price of the take-profit leg, for an LO attached_activate_order_type.",
      +  "type": "string"
      +}
    • addedInput schema / properties / attached_stop_loss_price
      Added value: +{
      +  "description": "Stop-loss trigger price. Required for STOP_LOSS and BRACKET.",
      +  "type": "string"
      +}
    • addedInput schema / properties / attached_stop_loss_submit_price
      Added value: +{
      +  "description": "Limit price of the stop-loss leg, for an LO attached_activate_order_type.",
      +  "type": "string"
      +}
    • addedInput schema / properties / attached_time_in_force
      Added value: +{
      +  "description": "Time-in-force of the attached leg: \"Day\" / \"GTC\" / \"GTD\". Defaults to\nthe parent order's setting when omitted.",
      +  "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 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"
      +}
    • 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. Changed1 schema field changedv0.7.1
    • removedInput schema / title
      Removed value: -"SubmitOrderParam"
  5. Changed4 schema fields changedv0.6.0
    • removedOutput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • removedOutput schema / description
      Removed value: -"Returned by `submit_order`."
    • removedOutput schema / properties / order_id / description
      Removed value: -"The newly-created order ID. Pass this to `cancel_order` /\n`replace_order` / `order_detail`."
    • removedOutput schema / title
      Removed value: -"OrderIdResponse"
  6. Addedv0.4.5
  7. Removedv0.4.0
  8. Addedv0.3.2
  9. Removedv0.3.1
  10. First observedv0.1.12

TDQS

A4.1/5.0
Behavior5/5

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

The description discloses the critical behavioral trait: without execute, nothing is sent; the dry run returns a confirmation code that is single-use, expires in 10 minutes, and applies only to the exact order. It also warns against quoting the code on the agent's own initiative or in the same turn. This goes well beyond the annotations (destructiveHint=true, readOnlyHint=false) and directly supports safe usage.

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 two sentences, front-loaded with the action and the dry-run safety rule. The critical confirmation protocol is stated up front, and the execute parameter description later reinforces it. There is no wasted wording.

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 complex 25-parameter mutation tool, the description captures the essential safety workflow and leaves field-level detail to the fully-covered schema. It doesn't describe return values, but no output schema exists and the preview/confirmation_code behavior is implied. It could mention idempotency or order-type variations, but those are documented in the schema.

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 itself documents every parameter in detail, including the execute protocol and conditional requirements. The main description does not add parameter-level semantics beyond the schema, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action: 'Submit a buy/sell order,' and immediately clarifies the dry-run/confirmation behavior. It doesn't explicitly distinguish from sibling tools like submit_multileg_order or replace_order, but the resource and action are clear enough for an agent to know what the tool does.

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 gives an explicit two-step protocol: call without execute, show the preview to the user, then re-call with the confirmation code after explicit confirmation. It doesn't discuss when to use this tool versus alternatives like submit_multileg_order or replace_order, but it provides clear context for the safe invocation workflow.

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