Skip to main content
Glama
yigitabi5444

Polymarket MCP Server

by yigitabi5444

get_order_books

Retrieve order books for multiple Polymarket prediction market tokens in a single batch request to analyze market depth and liquidity.

Instructions

Get order books for multiple Polymarket tokens in a single batch request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
token_idsYesArray of CLOB token IDs

Implementation Reference

  • The MCP tool "get_order_books" is registered here, which calls clob.getOrderBooks.
    server.tool(
      "get_order_books",
      "Get order books for multiple Polymarket tokens in a single batch request.",
      {
        token_ids: z
          .array(z.string())
          .min(1)
          .max(20)
          .describe("Array of CLOB token IDs"),
      },
      async (args) => {
        try {
          const data = await clob.getOrderBooks(args.token_ids);
          return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error: ${(error as Error).message}` }],
            isError: true,
          };
        }
      },
    );
  • This is the underlying API method used by the "get_order_books" tool.
    async getOrderBooks(tokenIds: string[]): Promise<ClobOrderBook[]> {
      return this.client.clobPost<ClobOrderBook[]>("/books", tokenIds);
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it's a batch request. It lacks details on rate limits, permissions, response format, pagination, or error handling for a tool that likely queries financial data.

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, efficient sentence with no wasted words, clearly front-loading the core purpose. Every part earns its place.

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

Completeness2/5

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

For a tool with no annotations and no output schema, the description is insufficient. It doesn't explain what an 'order book' contains, the response structure, or any behavioral traits like latency or data freshness, leaving significant gaps for an AI agent.

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%, with the parameter 'token_ids' well-documented in the schema. The description adds no additional meaning beyond implying these are for 'Polymarket tokens,' which is already suggested by the tool name.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get order books') and resource ('multiple Polymarket tokens'), specifying it's a batch request. However, it doesn't distinguish this from the sibling 'get_order_book' tool, which presumably handles single tokens.

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

Usage Guidelines2/5

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

The description mentions 'batch request' but provides no explicit guidance on when to use this vs. the singular 'get_order_book' tool or other market-related siblings. No alternatives, prerequisites, or exclusions are stated.

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