Skip to main content
Glama

Perp Spreads History

perp_spreads_history
Read-onlyIdempotent

History of the price spread between two venues for one symbol, perp or spot, in 1h, 4h or 1d buckets: (A / B - 1) x 10,000 bps, positive when exchange_a is above exchange_b. Each leg is priced every minute (the book mid where the venue quotes a book, else its last price) and measured against the cross-venue median of the symbol's perp venues, so any pair (binance perp vs okx perp, bybit spot vs hyperliquid perp) comes from one history. Per bucket: open_bps, close_bps, avg_bps; high_bps_bound and low_bps_bound BOUND the extremes (each leg's own extreme can fall on a different minute), they are not observed values; samples_a / samples_b = minutes priced (at most 60 an hour); book_bps_a / book_bps_b = the leg's mean quoted bid-ask width, null without a book. Covers the perp symbols listed on at least two major venues (about 300) and their spot pairs, from 2026-05-30. A bucket where one leg was not priced has no row; nothing found returns empty rows and a note, never zeros. Default window: the last 7 days; at most 10,000 buckets a call. For the spreads right now use perp_spreads.

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>",
      "exchange_a": "<exchange_a>",
      "exchange_b": "<exchange_b>"
    },
    "name": "perp_spreads_history"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoISO 8601 or unix seconds, exclusive. Default: now.
startNoISO 8601 ('2026-11-01', '2026-11-01T12:00:00Z') or unix seconds. Default: 7 days before end.
symbolYesRequired. Base asset, e.g. 'BTC', 'ETH', 'SOL' (not 'BTCUSDT').
intervalNoBucket size; 4h and 1d buckets start at 00:00 UTC.1h
market_aNoLeg A's market.perp
market_bNoLeg B's market.perp
exchange_aYesRequired. Leg A's venue, lower case, e.g. 'binance'.
exchange_bYesRequired. Leg B's venue, lower case, e.g. 'okx'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive, and closed-world behavior, but the description adds substantial context beyond them: minute-level leg pricing, cross-venue median normalization, exact bucket field meanings, the caveat that high/low bounds are not observed values, sample counts, and null book-width semantics. It also discloses missing-bucket behavior and the guarantee that empty results include a note rather than zeros.

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

Conciseness4/5

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

The description is long but well front-loaded, opening with purpose and formula before methodology, field definitions, coverage, edge cases, and the sibling alternative. Every sentence is information-dense, though the parenthetical methodology and bound caveats make it heavier than strictly necessary for selection.

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, so the description must define return semantics, and it does: open_bps, close_bps, avg_bps, bounded high/low, sample counts, and book-width fields. It also covers coverage limits, start date, missing-bucket behavior, default windows, and the empty-result note, making the definition complete for this 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 parameter descriptions already carry most of the load. The tool description still adds useful meaning beyond the schema by clarifying the sign convention relative to exchange_a and exchange_b and by giving concrete cross-market pair examples that explain how market_a and market_b combine.

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 a precise verb and resource: historical price-spread data between two venues for one symbol, with bucket intervals and a clear bps formula. It distinguishes itself from the sibling perp_spreads by explicitly saying the latter is for current spreads, so an agent can route correctly without inspecting schemas.

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

Usage Guidelines5/5

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

It names the direct alternative, perp_spreads, and gives the condition that selects it: use perp_spreads for spreads right now. It also states the default window, the coverage universe, the 10,000-bucket cap, and the empty-result behavior, leaving little ambiguity about when and how to use the tool.

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.