Skip to main content
Glama
yigitabi5444

Polymarket MCP Server

by yigitabi5444

get_order_book_summary

Retrieve summarized order book data for Polymarket tokens, showing best bid, best ask, and spread to analyze market liquidity and pricing.

Instructions

Get a summarized order book for a Polymarket token: best bid, best ask, and spread.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
token_idYesCLOB token ID

Implementation Reference

  • The handler function for the 'get_order_book_summary' tool. It calls the clob API and returns the result as a JSON string.
    server.tool(
      "get_order_book_summary",
      "Get a summarized order book for a Polymarket token: best bid, best ask, and spread.",
      {
        token_id: z.string().describe("CLOB token ID"),
      },
      async (args) => {
        try {
          const data = await clob.getOrderBookSummary(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 underlying implementation method that interacts with the CLOB API for 'get_order_book_summary'.
    async getOrderBookSummary(tokenId: string): Promise<ClobOrderBookSummary> {
      return this.client.clob<ClobOrderBookSummary>("/order-book-summary", {
        token_id: tokenId,
      });
    }

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