Skip to main content
Glama

prediction.liquidity_depth_after_haircut

Calculate a Polymarket outcome's tradable depth within a set price-impact bound, before and after discounting top-of-book size to model cancellation risk.

Instructions

A single Polymarket outcome's executable depth within
max_price_impact_pct (default 5.0%) of the best quote, both before and
after discounting the top-of-book level's size by haircut_pct (default
10.0%) to model the risk that the very best resting order gets cancelled
before you can trade against it. Does not detect or flag actual spoofing
(out of scope - see architecture-roadmap.md Phase 3). Reuses the same
order-book fetch as prediction.exit_capacity_audit/order_split_guide -
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.
    side: "sell" (default) or "buy".
    haircut_pct: Percent to discount the top-of-book level's size by,
        modeling cancellation risk. Defaults to 10.0.
    max_price_impact_pct: Price-impact bound (percent of best quote)
        within which depth is summed. Defaults to 5.0.

Returns:
    On success: {"success": true, "best_quote",
        "depth_shares_before_haircut", "depth_shares_after_haircut", ...}
    On failure: {"success": false, "error": {"type", "message"}}

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

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

Input Schema

NameRequiredDescriptionDefault
sideNosell
outcomeNoyes
token_idNo
haircut_pctNo
market_slugNo
max_price_impact_pctNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.6.0

TDQS

A4.2/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 behavioral burden and does reasonably well: it explains the core model (discount top-of-book size by haircut_pct for cancellation risk), discloses all defaults, states the out-of-scope boundary, and documents the success/failure return shapes. It omits operational traits like rate limits or auth requirements, but the computational semantics and error contract are clearly surfaced.

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?

Well-structured with a definition paragraph followed by clear Args and Returns sections, and the tool's purpose is front-loaded. Slightly verbose — the 'reuses the same order-book fetch' note and the roadmap reference are marginal — but every element is informative and nothing is 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 6-parameter tool with no annotations and no output schema, the description fills both gaps: all inputs are documented and the return object is sketched, including the failure shape. Only minor gaps remain (no pagination/permission notes, return fields shown with ellipses rather than fully enumerated), so it is nearly complete.

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 coverage is 0%, so the description must compensate and it does: every parameter is explained with meaning beyond its name, including the mutual-exclusivity rule ('provide either token_id OR market_slug'), that outcome is ignored when token_id is given, and the semantics of side, haircut_pct, and max_price_impact_pct. This is exactly what an agent needs given the bare 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?

States a specific, well-defined computation: executable depth for a single Polymarket outcome within max_price_impact_pct, both before and after a cancellation-risk haircut. It explicitly scopes itself out of spoofing detection and names the sibling tools (exit_capacity_audit, order_split_guide) it shares a fetch with, so an agent can place it precisely among siblings.

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

Usage Guidelines3/5

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

It gives one useful exclusion ('does not detect or flag actual spoofing - out of scope') and notes it reuses the same order-book fetch as exit_capacity_audit/order_split_guide, so the agent knows it incurs no new upstream call. However, it never says when to choose this tool versus those siblings (e.g., depth-after-haircut vs. exit capacity), leaving the routing decision to inference.

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