Skip to main content
Glama
longbridge

longbridge

Official

Estimate Max Purchase Quantity

estimate_max_purchase_quantity
Read-onlyIdempotent

Calculate maximum buy or sell quantity for a given symbol, with optional order type and limit price. Use this to determine tradable size before placing an order.

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
sideNoBuy or Sell (case-insensitive; default: Buy)Buy
priceNoLimit price for limit-style orders. Omit for market orders.
symbolYesSecurity symbol, e.g. "700.HK"
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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
cash_max_qtyYes
margin_max_qtyYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv0.7.1
    • removedInput schema / title
      Removed value: -"EstimateMaxQtyParam"
  2. 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"
  3. 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"
      +]
  4. Addedv0.4.5
  5. Removedv0.4.0
  6. Addedv0.3.2
  7. Removedv0.3.1
  8. First observedv0.1.12

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already indicate readOnly, openWorld, idempotent, and non-destructive. The description adds case-insensitivity and default behavior, which is helpful but does not contradict annotations. Adds value beyond structured data.

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, front-loaded sentence that efficiently conveys core purpose and key defaults. No redundant information.

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?

With output schema present, return values need not be explained. The description covers required parameters, defaults, and optional fields adequately. Could mention that it estimates max quantity, but title already implies. Complete for its complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds context by stating required parameter 'symbol', defaults for 'side' and 'order_type', and optional 'price', along with case-insensitivity. This enhances usability beyond the schema.

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 'Estimate maximum buy/sell quantity for a symbol' with specific verb and resource. It clearly distinguishes from sibling tools like submit_order or quote by focusing on estimation, not execution or retrieval.

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 provides defaults for side, order_type, and notes price is optional. While it doesn't explicitly say when to use vs alternatives, the context of estimation vs order placement is clear. No direct exclusions but sufficient guidance.

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