Skip to main content
Glama

pm_micro_depth

Analyze Polymarket order book depth to view bid-ask spreads, liquidity levels, and price distribution for specific markets.

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 that executes the pm_micro_depth tool, calling the API endpoint and processing the result.
    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}` }],
      };
    },
  • Registration of the pm_micro_depth tool, including its schema and name.
    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)"),
        },
      },

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