Skip to main content
Glama

pm_micro_stats

Analyze Polymarket microstructure data to monitor total markets, average spreads, thin book counts, and update timestamps for trading insights.

Instructions

Get statistics about the Polymarket microstructure dataset: total markets analyzed, average spread, thin book count, and last updated. Free endpoint.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for pm_micro_stats that fetches data from the API and formats it for the MCP tool response.
    server.registerTool(
      "pm_micro_stats",
      {
        title: "Polymarket Microstructure Statistics",
        description:
          "Get statistics about the Polymarket microstructure dataset: total markets analyzed, " +
          "average spread, thin book count, and last updated. Free endpoint.",
        inputSchema: {},
      },
      async () => {
        const res = await apiGet<PmMicroStatsResponse>("/api/v1/pm/micro/stats");
    
        if (!res.ok) {
          return {
            content: [
              {
                type: "text" as const,
                text: `API error (${res.status}): ${JSON.stringify(res.data)}`,
              },
            ],
            isError: true,
          };
        }
    
        return {
          content: [
            { type: "text" as const, text: JSON.stringify(res.data, null, 2) },
          ],
        };
      },
    );
  • Registration of the pm_micro_stats tool within the registerPmMicroTools function.
    server.registerTool(
      "pm_micro_stats",
      {
        title: "Polymarket Microstructure Statistics",
        description:
          "Get statistics about the Polymarket microstructure dataset: total markets analyzed, " +
          "average spread, thin book count, and last updated. Free endpoint.",
        inputSchema: {},
      },
      async () => {
        const res = await apiGet<PmMicroStatsResponse>("/api/v1/pm/micro/stats");
    
        if (!res.ok) {
          return {
            content: [
              {
                type: "text" as const,
                text: `API error (${res.status}): ${JSON.stringify(res.data)}`,
              },
            ],
            isError: true,
          };
        }
    
        return {
          content: [
            { type: "text" as const, text: JSON.stringify(res.data, null, 2) },
          ],
        };
      },
    );
  • The TypeScript interface defining the structure of the response for the pm_micro_stats tool.
    interface PmMicroStatsResponse {
      dataset: string;
      source: string;
      update_frequency: string;
      stats: Record<string, unknown>;
    }

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