Skip to main content
Glama
PaulieB14

graph-polymarket-mcp

get_clob_market

Get CLOB market data by condition ID: returns token IDs, current prices, minimum order sizes, and market status for trading.

Instructions

Get CLOB market details by condition ID. Returns token IDs (token_id) with live prices, minimum order/tick sizes, and market status. This is the bridge between on-chain condition IDs and CLOB trading data. Use the returned token_id values with get_live_prices, get_live_spread, get_live_orderbook, get_price_history, or get_market_positions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conditionIdYesMarket condition ID (hex string)

Implementation Reference

  • src/index.ts:1267-1287 (registration)
    MCP tool registration for 'get_clob_market' tool. Defines the tool name, description, input schema (conditionId string), and handler that calls the getClobMarket function and formats the result.
    // ---------------------------------------------------------------------------
    // Tool 30: get_clob_market
    // ---------------------------------------------------------------------------
    server.registerTool(
      "get_clob_market",
      {
        description:
          "Get CLOB market details by condition ID. Returns token IDs (token_id) with live prices, minimum order/tick sizes, and market status. This is the bridge between on-chain condition IDs and CLOB trading data. Use the returned token_id values with get_live_prices, get_live_spread, get_live_orderbook, get_price_history, or get_market_positions.",
        inputSchema: {
          conditionId: z.string().describe("Market condition ID (hex string)"),
        },
      },
      async ({ conditionId }) => {
        try {
          const market = await getClobMarket(conditionId);
          return textResult(market);
        } catch (error) {
          return errorResult(error);
        }
      }
    );
  • The actual implementation of the CLOB market data fetcher. Makes a GET request to https://clob.polymarket.com/markets/{conditionId} and returns the parsed JSON as a ClobMarket object.
    export async function getClobMarket(conditionId: string): Promise<ClobMarket> {
      return fetchJson<ClobMarket>(
        `${CLOB_BASE}/markets/${encodeURIComponent(conditionId)}`
      );
    }
  • TypeScript interface defining the shape of the ClobMarket object returned by the API. Includes condition_id, question_id, tokens array (with token_id/outcome/price/winner), market metadata, and an index signature for additional fields.
    export interface ClobMarket {
      condition_id: string;
      question_id: string;
      tokens: Array<{
        token_id: string;
        outcome: string;
        price: number;
        winner: boolean;
      }>;
      minimum_order_size: string;
      minimum_tick_size: string;
      description: string;
      market_slug: string;
      end_date_iso: string;
      active: boolean;
      closed: boolean;
      accepting_orders: boolean;
      accepting_order_timestamp: string;
      [key: string]: unknown;
    }
  • src/index.ts:10-24 (registration)
    Import of getClobMarket from polymarketApi.ts into the main server file, providing the handler function used by the tool registration.
    import {
      searchMarkets,
      getMarketBySlug,
      getMarketByConditionId,
      listEvents,
      getEvent,
      getClobPrice,
      getClobPricesBatch,
      getClobMidpoint,
      getClobSpread,
      getClobOrderBook,
      getClobLastTradePrice,
      getClobPriceHistory,
      getClobMarket,
    } from "./polymarketApi.js";
Behavior4/5

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

No annotations are provided, so the description must carry behavioral disclosure. It states the tool is read-only (returns data) and describes the output fields. It does not cover errors, permissions, or rate limits, but for a simple lookup tool this is reasonably transparent.

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?

Three concise sentences: first states purpose and output, second reinforces role, third gives usage guidance. No extraneous information, properly front-loaded.

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?

Given no output schema, the description adequately explains the return values (token IDs, prices, sizes, status) and how to use the output with other tools. It does not mention error handling or pagination, but for a simple query tool with one parameter, this is sufficient.

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

Parameters4/5

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

Schema coverage is 100% for the single parameter. The description adds context by explaining the parameter's role ('by condition ID') and how the output (token_id) relates to other tools, which adds meaning beyond the schema's basic hex string description.

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 tool gets CLOB market details by condition ID, listing specific return fields (token IDs, live prices, sizes, status). It also positions itself as a bridge between on-chain IDs and CLOB data, distinguishing it from sibling tools.

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

Usage Guidelines4/5

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

The description explicitly advises using the returned token_id values with several sibling tools (get_live_prices, etc.), providing a clear next-step context. It implicitly indicates usage when you have a condition ID and need trading data, but does not explicitly state when not to use it.

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/PaulieB14/graph-polymarket-mcp'

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