Skip to main content
Glama

Perp Long Short

perp_long_short
Read-onlyIdempotent

Long/short positioning that perp venues publish for one symbol: binance, bitget, bybit, gate, okx. The venues do NOT measure the same thing, so every row carries basis: binance = top traders by POSITIONS; okx and gate = top traders by ACCOUNTS; bybit and bitget = ALL accounts. Compare a venue with itself over time, never as a like-for-like average across venues. long_share / short_share are fractions of 1 (0.63 = 63 %); long_short_ratio = long / short (1.72 = 1.72 longs per short; above 1 is long-heavy). Without hours, start or end: the newest 5-minute print per venue and its age in seconds (venues printed within the last hour, stale_venues went silent). With hours (1-8760, the hours before now) or start / end (a window; not with hours): a series per venue of [ts, long_short_ratio] pairs, the last print in each interval bucket (1h by default, 4h or 1d; 4h and 1d start at 00:00 UTC; ts the bucket's start), or with interval 'raw' every stored print at its own ts (the venue's own time of the print, on its 5-minute boundary; at most 7 days a call, page with start / end). History is kept a year (binance, bybit, okx and gate from 2026-04-10 for about 40 major symbols, the others from 2026-11-02 on binance, bybit and gate and 2026-11-27 on okx; bitget from 2026-04-09 22:00 to 2026-04-10 16:20, then from 2026-11-28 16:00 (4-hourly to 2026-12-01 04:00, hourly to 23:00, every 5 minutes from 23:30); or from the perp's listing, if later); at most 10,000 buckets a call, and a longer window is refused, never cut short. Covers every perp whose open interest Vike collects on the venue (on gate, every perp it tracks there), stock perps included, read every 5 minutes; bitget publishes long/short for 18 symbols only. Any other symbol returns empty lists and a note, never zeros. symbol is the canonical base asset ('BTC').

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "symbol": "<symbol>"
    },
    "name": "perp_long_short"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoA series up to this time, exclusive: ISO 8601 or unix seconds. Default: now.
hoursNoA series over this many hours before now, 1 to 8760 (a year; 1 to 168 with interval raw). Not with start/end. Omit hours, start and end for the latest print per venue.
startNoA series from this time, inclusive: ISO 8601 ('2026-11-01', '2026-11-01T12:00:00Z') or unix seconds, floored to the interval. Default: 7 days before end.
symbolYesRequired. Base asset, e.g. 'BTC', 'ETH', 'SOL' (not 'BTCUSDT').
exchangeNoOnly this venue (lower case), e.g. 'okx'. Omit for every venue.
intervalNoThe bucket of a series: 1h (default), 4h or 1d; 4h and 1d start at 00:00 UTC. raw: every stored print at its own time, at most 7 days a call. Only with hours, start or end.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / hours / description
      Previous value: -"A series over this many hours before now, 1 to 8760 (a year). Not with start/end. Omit hours, start and end for the latest print per venue."New value: +"A series over this many hours before now, 1 to 8760 (a year; 1 to 168 with interval raw). Not with start/end. Omit hours, start and end for the latest print per venue."
    • changedInput schema / properties / interval / description
      Previous value: -"The bucket of a series: 1h (default), 4h or 1d; 4h and 1d start at 00:00 UTC. Only with hours, start or end."New value: +"The bucket of a series: 1h (default), 4h or 1d; 4h and 1d start at 00:00 UTC. raw: every stored print at its own time, at most 7 days a call. Only with hours, start or end."
    • changedInput schema / properties / interval / enum
      Previous value: -[
      -  "1h",
      -  "4h",
      -  "1d"
      -]New value: +[
      +  "1h",
      +  "4h",
      +  "1d",
      +  "raw"
      +]
  2. Changed4 schema fields changed
    • addedInput schema / properties / end
      Added value: +{
      +  "description": "A series up to this time, exclusive: ISO 8601 or unix seconds. Default: now.",
      +  "type": "string"
      +}
    • changedInput schema / properties / hours / description
      Previous value: -"Omit for the latest print per venue. 1 to 168 for an hourly series over that many hours."New value: +"A series over this many hours before now, 1 to 8760 (a year). Not with start/end. Omit hours, start and end for the latest print per venue."
    • addedInput schema / properties / interval
      Added value: +{
      +  "description": "The bucket of a series: 1h (default), 4h or 1d; 4h and 1d start at 00:00 UTC. Only with hours, start or end.",
      +  "enum": [
      +    "1h",
      +    "4h",
      +    "1d"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / start
      Added value: +{
      +  "description": "A series from this time, inclusive: ISO 8601 ('2026-11-01', '2026-11-01T12:00:00Z') or unix seconds, floored to the interval. Default: 7 days before end.",
      +  "type": "string"
      +}
  3. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only cover the safe-read profile, and the description adds substantial behavior: per-venue `basis` differences, freshness signaling via `venues`/`stale_venues`, coverage limits (bitget's 18 symbols, gate's tracked perps), empty lists plus a note instead of zeros, a 10,000-bucket cap that refuses rather than truncates, and a year of retention with per-venue start dates.

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?

Front-loading is good — the venue-basis warning comes before any parameter talk — and little is pure filler. However it is one dense run-on block with deeply nested parentheticals; the retention clause ('bitget from 2026-04-09 22:00 to 2026-04-10 16:20, then from 2026-11-28 16:00 (4-hourly to 2026-12-01 04:00, hourly to 23:00, every 5 minutes from 23:30)') is nearly unparseable and would be better as a list.

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?

There is no output schema, and the description fully carries the return contract: snapshot shape (`venues`, `stale_venues`, age in seconds), series shape (`[ts, long_short_ratio]` pairs), and the meaning of `long_share`/`long_short_ratio`. For a six-parameter, multi-mode tool this is complete enough to call correctly without further discovery.

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 the baseline is 3, but the description still adds meaning: it states that `hours` and `start`/`end` are mutually exclusive modes, how `interval` buckets align (4h/1d from 00:00 UTC, `ts` = bucket start), and that `raw` is capped at 7 days per call. Only the already-obvious parameter names are left to 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 names the specific resource (long/short positioning published per perp venue), enumerates the five venues, and defines the canonical symbol form ('BTC', not 'BTCUSDT'). It is immediately distinguishable from siblings like perp_open_interest or hl_perp_top_traders.

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?

Explicitly tells the agent how to read the numbers ('compare a venue with itself over time, never as a like-for-like average across venues') and splits the two calling modes: no time args = latest snapshot, hours/start/end = a series. It does not name any sibling tool or state when a different tool would be the better choice.

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.