Skip to main content
Glama

Ashares Margin Financing

ashares_margin_financing
Read-onlyIdempotent

China A-share margin financing and securities lending balance (融资融券余额/两融余额), the market-wide leverage gauge: aggregate financing balance (融资余额, money borrowed to buy stock), securities-lending balance (融券余额, shares borrowed to short), and their combined total (融资融券余额), for the Shanghai (SSE) and Shenzhen (SZSE) exchanges separately and combined, with day-over-day change. Answers '融资余额', '两融余额', '融资融券余额', 'margin financing balance', 'China A-share margin debt', 'how much margin debt is in the A-share market', 'margin balance day over day change'. Pass a 6-digit SZSE code (0/3/159-prefixed) in symbol for that stock's own 融资余额/融券余额/融资融券余额 instead of the market aggregate, SSE (6xxxxx) per-stock detail is not available via any verified keyless route, so a SH code returns a clear not_available message rather than silently substituting. Margin data publishes T+1 (today's figures appear tomorrow morning); a request for a day with nothing published yet or a non-trading day (weekend/holiday) automatically falls back to the last trading day that published, and says so. Amounts in CNY (converted from each exchange's native 元/亿元/万元 units and labelled). HISTORY: pass start_date/end_date or days (and interval=month_end for one row per month) for a dated series of SSE, SZSE and combined financing balances back to 2010-03-31, each row with the balance as a percent of float market value (e.g. 'A-share margin financing balance, last 6 month-ends'). Source: SSE margin trading figures via Eastmoney per-exchange margin history (keyless) + SZSE margin trading summary (keyless).

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "ashares_margin_financing"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNoTrading day as YYYY-MM-DD or YYYYMMDD (default: most recent day with published data). Margin data is T+1, so "today" usually has nothing yet.
daysNoHISTORY MODE alternative to start_date: the most recent N trading days (1-250). With interval month_end, N is a CALENDAR-day window back from end_date (1-7300): days:90 returns the month-ends inside the last 90 days. To count months use `months`.
monthsNoHISTORY MODE, interval month_end only: the most recent N month-ends (1-240). Ignored for daily.
symbolNoOptional 6-digit SZSE code (0/3/159-prefixed, e.g. "000001" 平安银行) for that stock's own margin balance instead of the market-wide aggregate. SSE codes (6xxxxx) are not supported here, no verified keyless per-stock route exists.
end_dateNoHISTORY MODE: last day of the series (default: most recent published day).
intervalNoHISTORY MODE: "daily" (default; at most 250 rows) or "month_end" (the last published trading day of each calendar month; at most 240 rows).
start_dateNoHISTORY MODE: first day of a series, YYYY-MM-DD or YYYYMMDD. Returns one dated row per trading day (or per month, see interval) with SSE, SZSE and combined financing balances, ending at end_date.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / days / description
      Previous value: -"HISTORY MODE alternative to start_date: the most recent N trading days (1-250). With interval month_end, N counts months (1-240)."New value: +"HISTORY MODE alternative to start_date: the most recent N trading days (1-250). With interval month_end, N is a CALENDAR-day window back from end_date (1-7300): days:90 returns the month-ends inside the last 90 days. To count months use `months`."
    • addedInput schema / properties / months
      Added value: +{
      +  "description": "HISTORY MODE, interval month_end only: the most recent N month-ends (1-240). Ignored for daily.",
      +  "type": "number"
      +}
  2. Changed4 schema fields changed
    • addedInput schema / properties / days
      Added value: +{
      +  "description": "HISTORY MODE alternative to start_date: the most recent N trading days (1-250). With interval month_end, N counts months (1-240).",
      +  "type": "number"
      +}
    • addedInput schema / properties / end_date
      Added value: +{
      +  "description": "HISTORY MODE: last day of the series (default: most recent published day).",
      +  "type": "string"
      +}
    • addedInput schema / properties / interval
      Added value: +{
      +  "description": "HISTORY MODE: \"daily\" (default; at most 250 rows) or \"month_end\" (the last published trading day of each calendar month; at most 240 rows).",
      +  "enum": [
      +    "daily",
      +    "month_end"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / start_date
      Added value: +{
      +  "description": "HISTORY MODE: first day of a series, YYYY-MM-DD or YYYYMMDD. Returns one dated row per trading day (or per month, see interval) with SSE, SZSE and combined financing balances, ending at end_date.",
      +  "type": "string"
      +}
  3. Changed1 schema field changed
    • changedInput schema / properties / symbol / description
      Previous value: -"Optional 6-digit SZSE code (0/3/159-prefixed, e.g. \"000001\" 平安银行) for that stock's own margin balance instead of the market-wide aggregate. SSE codes (6xxxxx) are not supported here — no verified keyless per-stock route exists."New value: +"Optional 6-digit SZSE code (0/3/159-prefixed, e.g. \"000001\" 平安银行) for that stock's own margin balance instead of the market-wide aggregate. SSE codes (6xxxxx) are not supported here, no verified keyless per-stock route exists."
  4. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive/openWorld, and the description adds substantial behavior beyond them: T+1 publication lag, automatic fallback to the last trading day on weekends/holidays or unpublished days with an explicit notice, CNY unit conversion from native 元/亿元/万元, and the not_available response for SSE codes. That is exactly the operational context an agent needs before calling.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose and constraints are front-loaded, and the HISTORY:/Source: markers help navigation, but the entry is one very long paragraph with repetition (the 融资余额/两融余额/融资融券余额 triad recurs three times) and long embedded quoted query strings. Every claim is relevant, yet the same content could be delivered in noticeably less text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter, no-output-schema tool this is complete: it covers what a single-day call returns, what history rows contain (dated SSE/SZSE/combined balances plus percent of float market value), the T+1 timing, fallback behavior, and the data source and coverage start (2010-03-31). An agent can call it correctly without further information.

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 the baseline is 3. The description restates the `symbol` constraint (6-digit SZSE, 0/3/159 prefixes) and the history-mode parameters, which largely duplicates the schema rather than adding syntax or defaults not already documented there.

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?

States a specific resource and verb-equivalent: China A-share margin financing and securities lending balance, naming the three components (融资余额, 融券余额, 融资融券余额) and both exchanges. It explicitly scopes the difference between the market-wide aggregate and a single SZSE stock, so an agent can tell what it will get and what it will not.

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?

Gives clear conditions for each mode: pass `symbol` for a per-stock figure instead of the aggregate, pass start_date/end_date or days (plus interval=month_end) for the history series. It also states an explicit when-not (SSE per-stock returns not_available rather than substituting). It does not name any sibling tool as an alternative, so it stops short of full when/when-not/alternatives routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.