Skip to main content
Glama

Polymarket Market Depth

pm_micro_depth

Analyzes Polymarket order book depth and bid-ask spread to show liquidity and spread width for assessing market conditions.

Instructions

Get market depth and bid-ask spread analysis for Polymarket markets. Shows order book depth, spread width, and liquidity at various price levels. Cost: $0.003 per query. Source: Polymarket order book analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idNoMarket ID to analyze
min_liquidityNoMinimum liquidity in USD
limitNoMaximum results (default 25)

Implementation Reference

  • The async handler function for pm_micro_depth tool. Calls API endpoint /api/v1/pm/micro/depth with market_id, min_liquidity, and limit parameters, then returns formatted results.
      async ({ market_id, min_liquidity, limit }) => {
        const res = await apiGet<PmMicroQueryResponse>("/api/v1/pm/micro/depth", {
          market_id,
          min_liquidity,
          limit: limit ?? 25,
        });
    
        if (!res.ok) {
          return {
            content: [
              {
                type: "text" as const,
                text: `API error (${res.status}): ${JSON.stringify(res.data)}`,
              },
            ],
            isError: true,
          };
        }
    
        const { count, data } = res.data;
        const warn = stalenessWarning(res);
        const summary = `${warn}Found ${count} market depth record(s).`;
        const json = JSON.stringify(data, null, 2);
    
        return {
          content: [{ type: "text" as const, text: `${summary}\n\n${json}` }],
        };
      },
    );
  • Input schema for pm_micro_depth tool: optional market_id (string), optional min_liquidity (number), optional limit (int 1-100, default 25).
    inputSchema: {
      market_id: z
        .string()
        .optional()
        .describe("Market ID to analyze"),
      min_liquidity: z
        .number()
        .optional()
        .describe("Minimum liquidity in USD"),
      limit: z
        .number()
        .int()
        .min(1)
        .max(100)
        .optional()
        .describe("Maximum results (default 25)"),
    },
  • Registration of pm_micro_depth tool via server.registerTool() with name, metadata, inputSchema, and handler callback.
    server.registerTool(
      "pm_micro_depth",
      {
        title: "Polymarket Market Depth",
        description:
          "Get market depth and bid-ask spread analysis for Polymarket markets. Shows " +
          "order book depth, spread width, and liquidity at various price levels. " +
          "Cost: $0.003 per query. Source: Polymarket order book analysis.",
        inputSchema: {
          market_id: z
            .string()
            .optional()
            .describe("Market ID to analyze"),
          min_liquidity: z
            .number()
            .optional()
            .describe("Minimum liquidity in USD"),
          limit: z
            .number()
            .int()
            .min(1)
            .max(100)
            .optional()
            .describe("Maximum results (default 25)"),
        },
      },
      async ({ market_id, min_liquidity, limit }) => {
        const res = await apiGet<PmMicroQueryResponse>("/api/v1/pm/micro/depth", {
          market_id,
          min_liquidity,
          limit: limit ?? 25,
        });
    
        if (!res.ok) {
          return {
            content: [
              {
                type: "text" as const,
                text: `API error (${res.status}): ${JSON.stringify(res.data)}`,
              },
            ],
            isError: true,
          };
        }
    
        const { count, data } = res.data;
        const warn = stalenessWarning(res);
        const summary = `${warn}Found ${count} market depth record(s).`;
        const json = JSON.stringify(data, null, 2);
    
        return {
          content: [{ type: "text" as const, text: `${summary}\n\n${json}` }],
        };
      },
    );
  • src/index.ts:31-58 (registration)
    Import of registerPmMicroTools function from pm_micro.ts module (used to register all pm_micro tools on the server).
    import { registerPmMicroTools } from "./tools/pm_micro.js";
    
    function createMcpServer() {
      const server = new McpServer({
        name: "verilex-data",
        version: "0.3.3",
      });
    
      registerNpiTools(server);
      registerSecTools(server);
      registerPacerTools(server);
      registerWeatherTools(server);
      registerOtcTools(server);
      registerTrademarkTools(server);
      registerPatentTools(server);
      registerCompanyTools(server);
      registerCryptoTools(server);
      registerSanctionsTools(server);
      registerWhaleTools(server);
      registerLabelTools(server);
      registerHolderTools(server);
      registerDexTools(server);
      registerContractTools(server);
      registerPmTools(server);
      registerPmArbTools(server);
      registerPmResolutionTools(server);
      registerEconTools(server);
      registerPmMicroTools(server);
  • The stalenessWarning helper used by the handler to check if returned data is stale.
    export function stalenessWarning(res: ApiResponse): string {
      if (!res.stale) return "";
      const parts = ["[STALE DATA]"];
      if (res.lastUpdated) parts.push(`Last updated: ${res.lastUpdated}`);
      if (res.ageSeconds != null) parts.push(`Age: ${res.ageSeconds}s`);
      return parts.join(" ") + "\n\n";
    }
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses that the tool retrieves and displays order book data (read-only behavior) and notes cost and source. However, it does not mention rate limits, data freshness, or any side effects (though presumably none). Basic transparency adequate for a simple query tool.

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 concise: three sentences front-loaded with the core purpose, followed by details of output and cost. No redundant or irrelevant information. Every sentence serves a clear role in defining the tool.

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 the tool has 3 parameters, no output schema, and no annotations, the description provides a solid overview of what it does and includes cost information. It explains the types of outputs (order book depth, spread width, liquidity at various price levels). However, it could be more complete by specifying the granularity of price levels or whether pagination applies, but overall it is sufficiently informative for a straightforward query tool.

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 coverage is 100% with each parameter described in the schema (market_id, min_liquidity, limit). The tool description does not add additional meaning beyond these descriptions; it repeats 'liquidity' but not parameter specifics. Thus, baseline score of 3 is appropriate.

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?

Description clearly states the tool retrieves market depth and bid-ask spread analysis for Polymarket markets, with specific outputs like order book depth, spread width, and liquidity at various price levels. The verb 'Get' and resource are explicit, and the tool is well-distinguished from siblings like pm_micro_thin by its focus on depth analysis.

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 for market depth queries but provides no explicit guidance on when to use this tool versus alternatives like pm_micro_stats or pm_micro_thin. It does mention cost ($0.003 per query) as a usage consideration, but lacks when-not-to-use or alternative tool referrals.

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/carrierone/verilexdata-mcp'

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