Skip to main content
Glama

prediction.orderbook_imbalance_ratio

Measure a Polymarket outcome's bid-side versus ask-side order-book depth imbalance within a chosen percentage band to assess buy/sell pressure. Returns depth shares and ratio; descriptive only.

Instructions

A single Polymarket outcome's bid-side vs ask-side order-book depth
ratio, summed within depth_band_pct (default 5.0%) of each side's own
best quote. 0.5 = balanced, closer to 1.0 = bid-side depth dominant,
closer to 0.0 = ask-side dominant. A descriptive statistic only - not a
prediction of price direction, no confidence or verdict field. Reuses
the same order-book fetch as prediction.exit_capacity_audit - no new
upstream call.

Args:
    token_id: The outcome's CLOB token_id / asset_id, if already known.
        Provide either this OR market_slug.
    market_slug: Exact Polymarket market slug, used to resolve token_id
        automatically when not already known.
    outcome: "yes" (default) or "no" - which side to resolve when using
        market_slug. Ignored if token_id is given directly.
    depth_band_pct: How far into the book, as a percent of each side's
        own best quote, to sum depth. Defaults to 5.0.

Returns:
    On success: {"success": true, "bid_depth_shares", "ask_depth_shares",
        "imbalance_ratio", ...}
    On failure: {"success": false, "error": {"type", "message"}}

Input Schema

NameRequiredDescriptionDefault
outcomeNoyes
token_idNo
market_slugNo
depth_band_pctNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.6.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does reasonably well: it discloses the tool is read-only/descriptive, that no verdict or confidence is produced, that it reuses an existing order-book fetch (no additional upstream call), and that failures return {success:false, error:{type,message}}. It omits auth requirements and rate-limit characteristics, which is the main remaining gap.

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 metric and its interpretation are front-loaded before the args, the Args/Returns structure is easy to scan, and the disclaimer sentence earns its place by preventing misuse as a directional signal. No filler.

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 4-parameter tool with no output schema and no annotations, the definition covers inputs fully and sketches the return shape ('bid_depth_shares', 'ask_depth_shares', 'imbalance_ratio', ...) plus the error shape. It is complete enough to call correctly, though the return fields are only partially enumerated and operational constraints (auth, rate limits) are absent.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate entirely, and it does: it documents all four parameters, states the token_id XOR market_slug relationship ('Provide either this OR market_slug'), explains that outcome is used only when resolving from market_slug and ignored otherwise, and gives depth_band_pct's default and units (percent of each side's own best quote).

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 computed metric — bid-side vs ask-side order-book depth ratio summed within a depth band — and gives a full interpretation scale (0.5 balanced, toward 1.0 bid-dominant, toward 0.0 ask-dominant). This distinguishes it from siblings like prediction.bid_ask_spread_pct, prediction.liquidity_depth_after_haircut, and prediction.exit_capacity_audit without needing to open any schema.

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?

It gives a clear when-not ('descriptive statistic only - not a prediction of price direction, no confidence or verdict field') and notes the relationship to prediction.exit_capacity_audit (same fetch, no new upstream call), which helps cost-aware routing. It does not, however, explicitly say when to prefer this over bid_ask_spread_pct or liquidity_depth_after_haircut.

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