Skip to main content
Glama
longbridge

longbridge

Official

Margin Ratio

margin_ratio
Read-onlyIdempotent

Retrieve the margin ratio for a given security symbol to assess borrowing power or risk.

Instructions

Get margin ratio for a symbol.

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.
symbolYesSecurity symbol, e.g. "700.HK". Use the canonical form — a padded code like "00700.HK" returns an empty record, not an error.

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": {
      -    "fm_factor": {
      -      "type": "string"
      -    },
      -    "im_factor": {
      -      "type": "string"
      -    },
      -    "mm_factor": {
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "im_factor",
      -    "mm_factor",
      -    "fm_factor"
      -  ],
      -  "type": "object"
      -}New value: +null
  3. Changed1 schema field changedv0.7.1
    • removedInput schema / title
      Removed value: -"SymbolParam"
  4. Changed6 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 `margin_ratio`.\n\nDecimals are stringified by `to_tool_json`."
    • removedOutput schema / properties / fm_factor / description
      Removed value: -"Forced close-out margin ratio (`fm_factor`)."
    • removedOutput schema / properties / im_factor / description
      Removed value: -"Initial-margin ratio (`im_factor`)."
    • removedOutput schema / properties / mm_factor / description
      Removed value: -"Maintenance-margin ratio (`mm_factor`)."
    • removedOutput schema / title
      Removed value: -"MarginRatioResponse"
  5. Addedv0.4.5
  6. Removedv0.4.0
  7. Addedv0.3.2
  8. Removedv0.3.1
  9. First observedv0.1.12

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, openWorldHint=true, and destructiveHint=false, so the read-only safety profile is covered. The description adds no extra behavioral context such as the padded-symbol empty-record quirk or return-shape expectations, making it adequate but not enriching.

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 a single, front-loaded sentence with no filler or repetition. Every word earns its place, which is exactly what conciseness requires.

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 simple read-only getter with rich annotations and a fully documented two-parameter schema, the description is sufficiently complete for invocation. The lack of an output schema is mitigated by the tool name and phrasing, though a bit more detail about the returned value would push it higher.

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%, including the warning that a padded symbol like '00700.HK' returns an empty record and the detailed _jq filter semantics. The tool description adds no parameter-level meaning beyond what the schema already provides, so it sits at the schema baseline.

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 names a specific resource ('margin ratio') and a required input ('symbol') with the verb 'Get', making the core purpose clear. It does not differentiate itself from related sibling tools such as short_margin or margin-related endpoints, so it stops short of a 5.

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

Usage Guidelines2/5

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

No guidance is given on when to use margin_ratio versus alternatives, nor are exclusions or prerequisites mentioned. The description only implies a narrow use case, which is insufficient for routing an agent to this tool over its siblings.

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