Skip to main content
Glama
longbridge

longbridge

Official

Order Detail

order_detail
Read-onlyIdempotent

Retrieve complete details for a specific parent order or an attached take-profit/stop-loss leg using its order ID.

Instructions

Get detailed information about a specific order. To look up such a leg by its own ID instead, pass it as order_id with is_attached=true: the response is then that leg, with charge_detail null.

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.
order_idYesOrder ID to look up. A parent order ID, or (with is_attached=true) the ID of an attached take-profit / stop-loss leg.
is_attachedNoSet to true when order_id is the ID of an attached take-profit / stop-loss leg rather than a parent order. The response is then that leg itself, with charge_detail null. Omit (or false) for parent orders. Has no effect for US accounts, which are served by the US order endpoint.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field 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."
  2. Changed4 schema fields changedv0.10.6
    • addedInput schema / properties / _jq
      Added value: +{
      +  "type": "string"
      +}
    • addedInput schema / properties / is_attached
      Added value: +{
      +  "description": "Set to true when order_id is the ID of an attached take-profit /\nstop-loss leg rather than a parent order. The response is then that leg\nitself, with charge_detail null. Omit (or false) for parent orders. Has\nno effect for US accounts, which are served by the US order endpoint.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / order_id / description
      Previous value: -"Order ID (from today's orders or order history)"New value: +"Order ID to look up. A parent order ID, or (with is_attached=true) the\nID of an attached take-profit / stop-loss leg."
    • changedOutput schema / (root)
      Previous value: -{
      -  "$defs": {
      -    "UsOrderDetail": {
      -      "properties": {
      -        "action": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "currency": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "done_at": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "executed_amount": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "executed_price": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "executed_qty": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "id": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "name": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "operate_direction": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "order_histories": {
      -          "items": {
      -            "$ref": "#/$defs/UsOrderHistoryEntry"
      -          },
      -          "type": [
      -            "array",
      -            "null"
      -          ]
      -        },
      -        "order_type": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "price": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "quantity": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "security_type": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "status": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "submitted_at": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "symbol": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "time_in_force": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        }
      -      },
      -      "type": "object"
      -    },
      -    "UsOrderHistoryEntry": {
      -      "properties": {
      -        "occurred_at": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "price": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "qty": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        },
      -        "status": {
      -          "type": [
      -            "string",
      -            "null"
      -          ]
      -        }
      -      },
      -      "type": "object"
      -    }
      -  },
      -  "properties": {
      -    "currency": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "current_millisecond": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "executed_price": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "executed_quantity": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "expire_date": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "last_done": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "limit_offset": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "msg": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "order": {
      -      "anyOf": [
      -        {
      -          "$ref": "#/$defs/UsOrderDetail"
      -        },
      -        {
      -          "type": "null"
      -        }
      -      ]
      -    },
      -    "order_id": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "order_type": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "outside_rth": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "price": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "quantity": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "side": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "status": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "stock_name": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "submitted_at": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "symbol": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "tag": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "time_in_force": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "trailing_amount": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "trailing_percent": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "trigger_at": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "trigger_price": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "trigger_status": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "updated_at": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    }
      -  },
      -  "type": "object"
      -}New value: +null
  3. 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)"
  4. Changed17 schema fields changedv0.8.4
    • addedOutput schema / $defs
      Added value: +{
      +  "UsOrderDetail": {
      +    "properties": {
      +      "action": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "currency": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "done_at": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "executed_amount": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "executed_price": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "executed_qty": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "id": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "name": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "operate_direction": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "order_histories": {
      +        "items": {
      +          "$ref": "#/$defs/UsOrderHistoryEntry"
      +        },
      +        "type": [
      +          "array",
      +          "null"
      +        ]
      +      },
      +      "order_type": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "price": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "quantity": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "security_type": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "status": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "submitted_at": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "symbol": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "time_in_force": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "UsOrderHistoryEntry": {
      +    "properties": {
      +      "occurred_at": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "price": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "qty": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      },
      +      "status": {
      +        "type": [
      +          "string",
      +          "null"
      +        ]
      +      }
      +    },
      +    "type": "object"
      +  }
      +}
    • changedOutput schema / properties / currency / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / current_millisecond
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / executed_quantity / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / msg / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / order
      Added value: +{
      +  "anyOf": [
      +    {
      +      "$ref": "#/$defs/UsOrderDetail"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ]
      +}
    • changedOutput schema / properties / order_id / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / order_type / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / quantity / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / side / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / status / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / stock_name / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / submitted_at / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / symbol / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / tag / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedOutput schema / properties / time_in_force / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • removedOutput schema / required
      Removed value: -[
      -  "order_id",
      -  "status",
      -  "symbol",
      -  "stock_name",
      -  "quantity",
      -  "executed_quantity",
      -  "submitted_at",
      -  "side",
      -  "order_type",
      -  "msg",
      -  "tag",
      -  "time_in_force",
      -  "currency"
      -]
  5. Changed1 schema field changedv0.7.1
    • removedInput schema / title
      Removed value: -"OrderIdParam"
  6. Changed28 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 `order_detail`. Single order with full lifecycle metadata."
    • removedOutput schema / properties / currency / description
      Removed value: -"Settlement currency."
    • removedOutput schema / properties / executed_price / description
      Removed value: -"Volume-weighted average executed price (null when unfilled)."
    • removedOutput schema / properties / executed_quantity / description
      Removed value: -"Quantity already executed."
    • removedOutput schema / properties / expire_date / description
      Removed value: -"GTD expiry date (yyyy-mm-dd)."
    • removedOutput schema / properties / last_done / description
      Removed value: -"Latest price snapshot at order time (null if missing)."
    • removedOutput schema / properties / limit_offset / description
      Removed value: -"Trailing-stop limit offset (TSLPAMT/TSLPPCT)."
    • removedOutput schema / properties / msg / description
      Removed value: -"Reject message or remark."
    • removedOutput schema / properties / order_id / description
      Removed value: -"Order ID."
    • removedOutput schema / properties / order_type / description
      Removed value: -"Order type enum, e.g. `LO`, `MO`, `LIT`."
    • removedOutput schema / properties / outside_rth / description
      Removed value: -"Outside-RTH setting: `RTH_ONLY` / `ANY_TIME` / `OVERNIGHT`."
    • removedOutput schema / properties / price / description
      Removed value: -"Submitted limit price (null for market orders)."
    • removedOutput schema / properties / quantity / description
      Removed value: -"Submitted quantity."
    • removedOutput schema / properties / side / description
      Removed value: -"Buy or Sell."
    • removedOutput schema / properties / status / description
      Removed value: -"Status enum (e.g. `Filled`, `WaitToNew`, `Canceled`)."
    • removedOutput schema / properties / stock_name / description
      Removed value: -"Display name of the security."
    • removedOutput schema / properties / submitted_at / description
      Removed value: -"Order submission time (RFC3339)."
    • removedOutput schema / properties / symbol / description
      Removed value: -"Security symbol, e.g. \"700.HK\"."
    • removedOutput schema / properties / tag / description
      Removed value: -"Order tag (e.g. `Normal`, `LongTerm`)."
    • removedOutput schema / properties / time_in_force / description
      Removed value: -"Time-in-force: `Day` / `GTC` / `GTD`."
    • removedOutput schema / properties / trailing_amount / description
      Removed value: -"Trailing-stop trail amount (TSLPAMT)."
    • removedOutput schema / properties / trailing_percent / description
      Removed value: -"Trailing-stop trail percent (TSLPPCT, decimal)."
    • removedOutput schema / properties / trigger_at / description
      Removed value: -"Conditional-order trigger time (RFC3339)."
    • removedOutput schema / properties / trigger_price / description
      Removed value: -"Trigger price for LIT/MIT/trailing orders."
    • removedOutput schema / properties / trigger_status / description
      Removed value: -"Trigger status, e.g. `Deactive` / `Active` / `Released`."
    • removedOutput schema / properties / updated_at / description
      Removed value: -"Last update time (RFC3339)."
    • removedOutput schema / title
      Removed value: -"OrderDetailResponse"
  7. Addedv0.4.5
  8. Removedv0.4.0
  9. Addedv0.3.2
  10. Removedv0.3.1
  11. First observedv0.1.12

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false. The description adds the behavioral detail that for an attached leg the response is that leg with charge_detail null, which is useful context beyond annotations. However, it does not disclose other behaviors like error handling or pagination.

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 concise sentences that front-load the primary purpose and then explain the special case. There is no filler or repetition; 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?

The tool is a simple get-by-id operation with three well-documented parameters and no output schema. The description covers the main purpose and the leg nuance, which is sufficient for an agent to invoke it correctly. It does not describe the response format, but that is often unnecessary for a lookup tool.

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 every parameter is already documented in the schema. The main description reiterates the is_attached=true behavior already present in the schema descriptions, adding no new semantic value. Baseline 3 is appropriate given the high coverage.

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 clearly states the tool's verb and resource: 'Get detailed information about a specific order.' It also explains a distinct use case (attached leg lookup) that differentiates it from a plain order fetch. This is specific and not a tautology.

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

Usage Guidelines3/5

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

The description gives clear guidance for the attached-leg scenario (when is_attached=true), but it does not mention when to use this tool versus other order-related siblings like history_orders, today_orders, or ipo_order_detail. The usage context is partial.

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