Skip to main content
Glama
yigitabi5444

Polymarket MCP Server

by yigitabi5444

get_order_book

Retrieve the full order book for a Polymarket prediction market token to analyze market depth, liquidity, and price levels.

Instructions

Get the full order book (bids and asks) for a Polymarket token. Shows market depth and liquidity at each price level.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
token_idYesCLOB token ID

Implementation Reference

  • Tool registration and handler definition for "get_order_book" in the CLOB tools module.
    server.tool(
      "get_order_book",
      "Get the full order book (bids and asks) for a Polymarket token. Shows market depth and liquidity at each price level.",
      {
        token_id: z.string().describe("CLOB token ID"),
      },
      async (args) => {
        try {
          const data = await clob.getOrderBook(args.token_id);
          return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error: ${(error as Error).message}` }],
            isError: true,
          };
        }
      },
    );
  • The actual API client method implementation for "get_order_book".
    async getOrderBook(tokenId: string): Promise<ClobOrderBook> {
      return this.client.clob<ClobOrderBook>(
        "/book",
        { token_id: tokenId },
        CACHE_TTLS.orderBook,
      );
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions what data is returned (bids, asks, depth, liquidity) but lacks behavioral details such as rate limits, authentication requirements, pagination, or error conditions. This is a significant gap for a tool with no annotation coverage.

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 description is a single, well-structured sentence that efficiently conveys the tool's purpose and key features without unnecessary words. It is front-loaded with the core action and resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description provides basic purpose but lacks completeness for a data retrieval tool. It doesn't cover response format, error handling, or performance characteristics, leaving gaps in understanding how to interpret results.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents the single parameter 'token_id' as a 'CLOB token ID'. The description adds no additional parameter semantics beyond implying it's for a Polymarket token, which aligns with the schema. Baseline 3 is appropriate when schema does the heavy lifting.

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 clearly states the action ('Get'), the resource ('full order book for a Polymarket token'), and specific details ('bids and asks', 'market depth and liquidity at each price level'). It distinguishes this tool from siblings like get_order_book_summary or get_last_trade_price by emphasizing comprehensive depth data.

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?

The description implies usage when needing detailed order book data for a specific token, but it doesn't explicitly state when to use this versus alternatives like get_order_book_summary (for aggregated data) or get_market_trades (for transaction history). No exclusions or prerequisites are mentioned.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yigitabi5444/yigit_polymarket_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server