Skip to main content
Glama

Polymarket Whale Wallets

pm_whales

Retrieve top Polymarket wallets ranked by profit and loss, volume, or position size. Access wallet address, total PnL, win rate, and active markets for smart money analysis.

Instructions

Get top Polymarket wallets ranked by PnL, volume, or position size. Shows wallet address, total PnL, win rate, and active markets. Cost: $0.005 per query. Source: Polymarket on-chain data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sortNoSort order (default: pnl)
market_idNoFilter by specific market ID
limitNoMaximum results (default 25)

Implementation Reference

  • Handler for the pm_whales tool. Calls /api/v1/pm/whales with optional sort, market_id, and limit params, formats response as text.
      async ({ sort, market_id, limit }) => {
        const res = await apiGet<PmQueryResponse>("/api/v1/pm/whales", {
          sort: sort ?? "pnl",
          market_id,
          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} Polymarket whale(s).`;
        const json = JSON.stringify(data, null, 2);
    
        return {
          content: [{ type: "text" as const, text: `${summary}\n\n${json}` }],
        };
      },
    );
  • Input schema for pm_whales with optional sort (enum pnl/volume/positions), market_id (string), and limit (1-100 integer).
    inputSchema: {
      sort: z
        .enum(["pnl", "volume", "positions"])
        .optional()
        .describe("Sort order (default: pnl)"),
      market_id: z
        .string()
        .optional()
        .describe("Filter by specific market ID"),
      limit: z
        .number()
        .int()
        .min(1)
        .max(100)
        .optional()
        .describe("Maximum results (default 25)"),
    },
  • src/tools/pm.ts:32-86 (registration)
    Registration of pm_whales tool via server.registerTool() with title, description, inputSchema, and async handler.
    server.registerTool(
      "pm_whales",
      {
        title: "Polymarket Whale Wallets",
        description:
          "Get top Polymarket wallets ranked by PnL, volume, or position size. " +
          "Shows wallet address, total PnL, win rate, and active markets. " +
          "Cost: $0.005 per query. Source: Polymarket on-chain data.",
        inputSchema: {
          sort: z
            .enum(["pnl", "volume", "positions"])
            .optional()
            .describe("Sort order (default: pnl)"),
          market_id: z
            .string()
            .optional()
            .describe("Filter by specific market ID"),
          limit: z
            .number()
            .int()
            .min(1)
            .max(100)
            .optional()
            .describe("Maximum results (default 25)"),
        },
      },
      async ({ sort, market_id, limit }) => {
        const res = await apiGet<PmQueryResponse>("/api/v1/pm/whales", {
          sort: sort ?? "pnl",
          market_id,
          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} Polymarket whale(s).`;
        const json = JSON.stringify(data, null, 2);
    
        return {
          content: [{ type: "text" as const, text: `${summary}\n\n${json}` }],
        };
      },
    );
  • Helper functions apiGet and stalenessWarning used by the pm_whales handler to call the Verilex API.
    export interface ApiResponse<T = unknown> {
      ok: boolean;
      status: number;
      data: T;
      stale?: boolean;
      lastUpdated?: string;
      ageSeconds?: number;
    }
    
    /** Build a staleness warning string if the data is stale, or empty string. */
    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";
    }
    
    /** Make a GET request to the Verilex API and return parsed JSON. */
    export async function apiGet<T = unknown>(
      path: string,
      params?: Record<string, string | number | undefined>,
    ): Promise<ApiResponse<T>> {
      const url = buildUrl(path, params);
    
      const headers: Record<string, string> = {
        Accept: "application/json",
        "User-Agent": "verilex-mcp-server/0.1.0",
      };
    
      // Forward x402 payment token if present in env (for paid endpoints)
      const paymentToken = process.env.VERILEX_PAYMENT_TOKEN;
      if (paymentToken) {
        headers["X-Payment-Token"] = paymentToken;
      }
    
      const res = await fetch(url, { headers });
      const data = (await res.json()) as T;
    
      const stale = res.headers.get("X-Data-Stale");
      const lastUpdated = res.headers.get("X-Data-Last-Updated");
      const ageSeconds = res.headers.get("X-Data-Age-Seconds");
    
      return {
        ok: res.ok,
        status: res.status,
        data,
        stale: stale === "true",
        lastUpdated: lastUpdated ?? undefined,
        ageSeconds: ageSeconds ? Number(ageSeconds) : undefined,
      };
    }
Behavior3/5

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

With no annotations, the description carries full burden. It discloses cost and data source, but does not mention rate limits, data freshness, or potential errors. The read-only nature is implied but not explicit.

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, front-loaded with the main action. Every sentence adds value: action, output fields, cost, and source. No unnecessary text.

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 three optional parameters and no output schema, the description covers the output fields and cost adequately. However, it lacks details on pagination or ordering defaults beyond the schema.

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?

All parameters have schema descriptions (100% coverage). The description adds value by explaining the output fields (wallet address, PnL, win rate, active markets), which is not in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves top Polymarket wallets ranked by PnL, volume, or position size, and lists the output fields. It is specific but does not explicitly differentiate from sibling tools like pm_signals or pm_changes.

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

Usage Guidelines2/5

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

The description mentions cost and data source but provides no guidance on when to use this tool versus alternatives. No when-not-to-use or alternative recommendations are given.

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