Skip to main content
Glama

prediction.polymarket_fee_estimate

Estimate Polymarket taker fees for a hypothetical fill using live fee rates and order-book quotes; excludes gas, slippage, and service charges.

Instructions

Polymarket's own taker fee (NOT gas, slippage, or AlphaPipeline's own
charge for this call) for a hypothetical fill of `shares` at `price`,
using the official bell-curve formula shares * fee_rate * price *
(1 - price). fee_rate is read live from Polymarket's own GET /fee-rate
for the exact token_id - never a hardcoded category table, since
per-category rates have changed before (see architecture-roadmap.md
Engineering Precision Backlog item 3). Makers pay 0 across every
category - this is the taker fee only. Omit price to use the live best
book quote for side (reuses the same order-book fetch as
prediction.exit_capacity_audit/order_split_guide - no new upstream call
in that case).

Args:
    shares: Hypothetical fill size, in shares. Must be > 0.
    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" - which side of the book to read
        price from when price is omitted.
    price: Hypothetical fill price (0-1 exclusive). Omit to use the
        live best book quote for side.

Returns:
    On success: {"success": true, "fee_rate", "fee_usd", "price",
        "base_fee_bp", ...}
    On failure: {"success": false, "error": {"type", "message"}}

Input Schema

NameRequiredDescriptionDefault
sideNosell
priceNo
sharesYes
outcomeNoyes
token_idNo
market_slugNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.6.0

TDQS

A4.3/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 so well: it discloses that fee_rate is fetched live from GET /fee-rate (never a hardcoded table), that makers pay 0 so this is taker-only, that omitting price triggers no new upstream call, and it shows the failure envelope. It stops short of auth/permission or rate-limit context, so not a 5.

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?

Front-loaded with the core purpose and formula, then cleanly sectioned into Args and Returns. Most sentences earn their place, though the parenthetical exclusions and the architecture-roadmap reference add some weight that could be trimmed.

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 6-param tool with no annotations and no output schema, the description supplies the formula, parameter contract, resolution logic, and the success/failure return shape. Nothing an agent needs to call it correctly is missing.

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% and there are 6 parameters, but the Args block documents every one: shares must be > 0, token_id vs market_slug mutual exclusivity, outcome's yes/no default and that it is ignored when token_id is given, side's sell/buy default, and price's 0-1 exclusive range. This fully compensates for the empty schema descriptions.

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 precise verb+resource (compute Polymarket's taker fee for a hypothetical fill) and disambiguates by explicitly excluding gas, slippage, and AlphaPipeline's own charge. It even names the exact formula and sibling tools it shares an order-book fetch with, so an agent can tell it apart from the surrounding prediction tools without opening a schema.

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?

Usage is implied rather than routed: the description clarifies parameterization (omit price to use the live quote, provide token_id OR market_slug) but never states when to pick this over siblings like prediction.exit_capacity_audit or order_split_guide, nor any when-not condition. The context is clear but alternatives are not addressed.

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