get_clob_market
Retrieve detailed trading parameters for a specific Polymarket prediction market, including token information, reward structures, tick sizes, and order book configurations using the condition ID.
Instructions
Get CLOB-specific market details by condition ID. Returns tokens, rewards, tick sizes, and trading parameters.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| condition_id | Yes | Market condition ID |
Implementation Reference
- src/tools/clob/markets.ts:12-22 (handler)The handler function for the "get_clob_market" tool, which calls the clob API.
async (args) => { try { const data = await clob.getMarket(args.condition_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, }; } }, - src/tools/clob/markets.ts:6-23 (registration)Registration of the "get_clob_market" tool using the MCP server.
server.tool( "get_clob_market", "Get CLOB-specific market details by condition ID. Returns tokens, rewards, tick sizes, and trading parameters.", { condition_id: z.string().describe("Market condition ID"), }, async (args) => { try { const data = await clob.getMarket(args.condition_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, }; } }, ); - src/api/clob.ts:54-56 (helper)The underlying API client call for "get_clob_market".
async getMarket(conditionId: string): Promise<ClobMarket> { return this.client.clob<ClobMarket>(`/markets/${conditionId}`); }