Skip to main content
Glama
longbridge

longbridge

Official

Estimate Max Purchase Quantity

estimate_max_purchase_quantity
Read-onlyIdempotent

Calculate the maximum buy or sell quantity for a given symbol, with configurable side, order type, and optional limit price to inform trade sizing.

Instructions

Estimate maximum buy/sell quantity for a symbol. Only symbol is required; side (case-insensitive Buy/Sell) defaults to Buy, order_type (case-insensitive) defaults to LO, and price is optional.

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.
sideNoBuy or Sell (case-insensitive; default: Buy)Buy
priceNoLimit price for limit-style orders. Omit for market orders.
symbolYesSecurity symbol, e.g. "700.HK". Use the canonical form — a padded code like "00700.HK" returns an empty record, not an error.
order_typeNoOrder type, case-insensitive (default: LO): LO (Limit Order) / ELO (Enhanced Limit Order) / MO (Market Order) / AO (At-auction) / ALO (At-auction Limit Order)LO

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 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 / 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. Changed2 schema fields changedv0.10.6
    • addedInput schema / properties / _jq
      Added value: +{
      +  "type": "string"
      +}
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "cash_max_qty": {
      -      "type": "string"
      -    },
      -    "margin_max_qty": {
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "cash_max_qty",
      -    "margin_max_qty"
      -  ],
      -  "type": "object"
      -}New value: +null
  3. Changed1 schema field changedv0.7.1
    • removedInput schema / title
      Removed value: -"EstimateMaxQtyParam"
  4. Changed5 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 `estimate_max_purchase_quantity`.\n\nBoth quantities are `Decimal` upstream and become strings after the\n`to_tool_json` serializer pipeline (snake_case + decimal stringification)."
    • removedOutput schema / properties / cash_max_qty / description
      Removed value: -"Maximum buy/sell quantity using cash buying power."
    • removedOutput schema / properties / margin_max_qty / description
      Removed value: -"Maximum buy/sell quantity using margin buying power."
    • removedOutput schema / title
      Removed value: -"EstimateMaxQtyResponse"
  5. Changed5 schema fields changedv0.4.9
    • addedInput schema / properties / order_type / default
      Added value: +"LO"
    • changedInput schema / properties / order_type / description
      Previous value: -"Order type: LO (Limit Order) / ELO (Enhanced Limit Order) / MO (Market Order) / AO (At-auction) / ALO (At-auction Limit Order)"New value: +"Order type, case-insensitive (default: LO): LO (Limit Order) / ELO (Enhanced Limit Order) / MO (Market Order) / AO (At-auction) / ALO (At-auction Limit Order)"
    • addedInput schema / properties / side / default
      Added value: +"Buy"
    • changedInput schema / properties / side / description
      Previous value: -"Buy or Sell"New value: +"Buy or Sell (case-insensitive; default: Buy)"
    • changedInput schema / required
      Previous value: -[
      -  "symbol",
      -  "side",
      -  "order_type"
      -]New value: +[
      +  "symbol"
      +]
  6. Addedv0.4.5
  7. Removedv0.4.0
  8. Addedv0.3.2
  9. Removedv0.3.1
  10. 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 cover read-only, idempotent, non-destructive aspects. The description adds case-insensitivity and default values, which are useful. It does not disclose response format or edge cases, but annotations handle most transparency needs.

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?

A single, focused sentence with no fluff. It front-loads the core purpose and then lists key defaults and optionality efficiently. It is appropriately brief and every word serves a purpose.

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 an estimation tool with full schema coverage and safe annotations, the description is complete. It provides necessary defaults and usage context, making it sufficient for an agent to call it correctly. No output schema means returns are not detailed, but that is not required given the tool's simplicity.

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 parameters are already described. The description adds default values and case-insensitivity, which adds some value but is not highly informative beyond the schema. Baseline 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 clearly states the tool estimates max buy/sell quantity for a symbol, with a specific verb and resource. It distinguishes from siblings like submit_order and replace_order by focusing on estimation rather than execution, though it does not explicitly name alternatives.

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 clear context: only symbol is required, and it explains defaults and optionality for side, order_type, and price. It does not explicitly say when not to use it versus alternatives, but the purpose implies it is for pre-trade estimation.

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