Skip to main content
Glama
PaulieB14

graph-polymarket-mcp

list_subgraphs

Retrieve a list of all Polymarket subgraphs, each with a description and key entities, to explore available prediction market data.

Instructions

List all available Polymarket subgraphs with descriptions and key entities

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:47-64 (registration)
    The tool 'list_subgraphs' is registered via server.registerTool() with the name 'list_subgraphs'. Its handler constructs an array from the SUBGRAPHS constant (defined in src/subgraphs.ts) and returns it as JSON.
    // Tool 1: list_subgraphs
    // ---------------------------------------------------------------------------
    server.registerTool(
      "list_subgraphs",
      {
        description: "List all available Polymarket subgraphs with descriptions and key entities",
      },
      async () => {
        const list = Object.entries(SUBGRAPHS).map(([key, cfg]) => ({
          id: key,
          name: cfg.name,
          ipfsHash: cfg.ipfsHash,
          description: cfg.description,
          keyEntities: cfg.keyEntities,
        }));
        return textResult(list);
      }
    );
  • The handler function for list_subgraphs: iterates over Object.entries(SUBGRAPHS) and maps each subgraph config (containing id, name, ipfsHash, description, keyEntities) into a list, then returns it via textResult().
    async () => {
      const list = Object.entries(SUBGRAPHS).map(([key, cfg]) => ({
        id: key,
        name: cfg.name,
        ipfsHash: cfg.ipfsHash,
        description: cfg.description,
        keyEntities: cfg.keyEntities,
      }));
      return textResult(list);
    }
  • The SubgraphConfig interface and SUBGRAPHS constant define the data schema used by list_subgraphs. Each subgraph has name, ipfsHash, description, and keyEntities fields.
    export interface SubgraphConfig {
      name: string;
      ipfsHash: string;
      description: string;
      keyEntities: string[];
    }
    
    export const SUBGRAPHS: Record<string, SubgraphConfig> = {
      main: {
        name: "Main",
        ipfsHash: "QmdyCguLEisTtQFveEkvMhTH7UzjyhnrF9kpvhYeG4QX8a",
        description:
          "Core Polymarket subgraph with markets, conditions, and trader counts. Best for: market discovery, condition resolution status, and counting open/closed markets. NOTE: volume/fee fields in Global are zeroed out — use the orderbook subgraph for accurate volume data.",
        keyEntities: [
          "Global (numConditions, numOpenConditions, numClosedConditions, numTraders)",
          "Condition (oracle, questionId, outcomeSlotCount, resolutionTimestamp, payoutNumerators)",
          "Account",
          "MarketData",
          "Transaction",
        ],
      },
      beefy_pnl: {
        name: "Beefy Profit and Loss",
        ipfsHash: "QmbHwcGkumWdyTK2jYWXV3vX4WyinftEGbuwi7hDkhPWqG",
        description:
          "The most comprehensive Polymarket analytics subgraph. UNIQUE FEATURES not available elsewhere: (1) Hedge fund-grade account metrics — winRate, profitFactor, maxDrawdown computed on-chain per trader. (2) Per-position P&L with realizedPnl, unrealizedPnl, cost basis (valueBought/valueSold). (3) Daily time-series — query as dailyStats_collection (NOT dailyStats) for daily volume, fees, numTraders, numNewMarkets, numResolvedMarkets. (4) Market-level analytics — currentPrice, numBuyers, numSellers. Best for: trader performance analysis, portfolio analytics, P&L tracking, and historical trend data.",
        keyEntities: [
          "Account (winRate, profitFactor, maxDrawdown, numWinning/LosingPositions)",
          "MarketPosition (realizedPnl, unrealizedPnl, valueBought, valueSold)",
          "dailyStats_collection (date, volume, fees, numTraders, numNewMarkets, numResolvedMarkets) — use _collection suffix for list queries",
          "Market (currentPrice, numBuyers, numSellers)",
          "MarketProfit",
          "Transaction",
          "TokenPosition",
          "UserStats",
        ],
      },
      slimmed_pnl: {
        name: "Slimmed P&L",
        ipfsHash: "QmZAYiMeZiWC7ZjdWepek7hy1jbcW3ngimBF9ibTiTtwQU",
        description:
          "Lightweight position tracker. Stores user token holdings with amount, avgPrice, realizedPnl, and totalBought. Best for: quick position lookups when you just need current holdings without full analytics. NOTE: indexers on this subgraph can lag; if queries fail with 'too far behind' errors, use the beefy_pnl subgraph instead.",
        keyEntities: ["UserPosition (amount, avgPrice, realizedPnl, totalBought)", "NegRiskEvent", "Condition", "FPMM"],
      },
      activity: {
        name: "Activity",
        ipfsHash: "Qmf3qPUsfQ8et6E3QNBmuXXKqUJi91mo5zbsaTkQrSnMAP",
        description:
          "Event log for position management operations. Tracks splits (minting outcome tokens), merges (combining tokens back to collateral), and redemptions (claiming payouts from resolved markets). Best for: monitoring position lifecycle events, tracking when users enter/exit markets, and auditing collateral flows.",
        keyEntities: [
          "Split (stakeholder, condition, amount, timestamp)",
          "Merge (stakeholder, condition, amount, timestamp)",
          "Redemption (redeemer, condition, payout, indexSets)",
          "NegRiskConversion",
          "NegRiskEvent",
        ],
      },
      orderbook: {
        name: "Orderbook",
        ipfsHash: "QmVGA9vvNZtEquVzDpw8wnTFDxVjB6mavTRMTrKuUBhi4t",
        description:
          "Detailed orderbook trading data and authoritative platform-wide volume. Every order fill with maker/taker, price, side, fee, and asset IDs. IMPORTANT: Use ordersMatchedGlobals for accurate total volume ($72B+), trade counts, and fees — the main subgraph Global entity has zeroed volume fields. Best for: analyzing trading patterns, tracking specific maker/taker activity, order flow analysis, per-market trade statistics, and platform volume metrics.",
        keyEntities: [
          "OrderFilledEvent (maker, taker, price, side, fee, amounts)",
          "OrdersMatchedEvent",
          "Orderbook (per-token trade stats)",
          "Global (platform-wide trade counts)",
          "Account (per-trader volume and activity)",
        ],
      },
      open_interest: {
        name: "Open Interest",
        ipfsHash: "QmbT2MmS2VGbGihiTUmWk6GMc2QYqoT9ZhiupUicYMWt6H",
        description:
          "The only Polymarket subgraph dedicated to open interest. Tracks USDC currently locked in outstanding YES/NO positions per market, with hourly snapshots for time-series analysis. OI is computed from PositionSplit (increases) and PositionsMerge (decreases) events on the ConditionalTokens contract. IMPORTANT: Polymarket does NOT use on-chain PayoutRedemption — winners sell shares on the orderbook or merge positions instead. This means resolved markets will still show residual OI from losing-side tokens that will never be redeemed. High OI on a resolved market = dead money (worthless losing tokens), not unclaimed winnings. Best for: identifying markets with the most capital at risk, charting OI trends over time, and detecting capital flow shifts across markets.",
        keyEntities: [
          "MarketOpenInterest (amount in USDC, splitCount, mergeCount — cross-reference with main subgraph for resolution status)",
          "OISnapshot (hourly bucketed OI per market — amount, timestamp, blockNumber)",
          "GlobalOpenInterest (total OI across all markets, marketCount)",
        ],
      },
      resolution: {
        name: "Market Resolution",
        ipfsHash: "QmZnnrHWCB1Mb8dxxXDxfComjNdaGyRC66W8derjn3XDPg",
        description:
          "Tracks the full UMA oracle resolution lifecycle for every Polymarket question. Each MarketResolution entity captures the current status (initialized → proposed → resolved), whether it was disputed, proposed/reproposed prices, and moderator flags. Revision entities log moderator updates with timestamps. Best for: monitoring market resolution progress, detecting disputed outcomes, auditing oracle activity, and checking if a market was flagged or paused.",
        keyEntities: [
          "MarketResolution (questionId, status, proposedPrice, price, flagged, paused, wasDisputed)",
          "Revision (moderator, questionId, timestamp, update)",
          "Moderator (address, canMod)",
          "AncillaryDataHashToQuestionId (maps ancillary data to questionId)",
        ],
      },
      traders: {
        name: "Traders",
        ipfsHash: "QmfT4YQwFfAi77hrC2JH3JiPF7C4nEn27UQRGNpSpUupqn",
        description:
          "Per-trader event log indexing every CTF interaction and USDC flow. Each Trader has a derived list of CTFEvents (splits, merges, transfers, resolutions, redemptions) and USDCTransfers (inbound/outbound with amounts). Best for: building trader profiles, tracking when a wallet first appeared, reconstructing a trader's full on-chain history, and analyzing USDC deposit/withdrawal patterns.",
        keyEntities: [
          "Trader (address, firstSeenBlock, firstSeenTimestamp)",
          "CTFEvent (eventType, conditionId, amounts, timestamp) — immutable, @derivedFrom trader",
          "USDCTransfer (from, to, amount, isInbound, timestamp) — immutable, @derivedFrom trader",
        ],
      },
    };
    
    export const SUBGRAPH_NAMES = Object.keys(SUBGRAPHS) as [string, ...string[]];
  • SUBGRAPH_NAMES is derived from Object.keys(SUBGRAPHS) and is exported for use in schema validations (enum definitions).
    export const SUBGRAPH_NAMES = Object.keys(SUBGRAPHS) as [string, ...string[]];
  • The textResult helper function formats tool responses as JSON string content. Used by the list_subgraphs handler.
    function textResult(data: unknown) {
      return {
        content: [{ type: "text" as const, text: JSON.stringify(data, null, 2) }],
      };
    }
Behavior3/5

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

The description indicates a read-only operation ('List'), consistent with the name, but does not disclose any additional behavioral traits such as authentication requirements, rate limits, or pagination behavior. Since annotations are absent, the description carries the full burden but adds only minimal context.

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 a single concise sentence with no redundant or extraneous information. Every word adds value.

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 simplicity (no parameters, no output schema), the description is largely complete. However, it could be enhanced by clarifying the relationship to sibling tools like get_subgraph_schema or query_subgraph, but current level is sufficient for basic understanding.

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?

The input schema has no parameters, and schema coverage is 100%. The description does not need to explain parameters, and it appropriately mentions 'all available' implying no filtering. No compensation required, so baseline 4 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?

The description clearly states the action (List), the resource (all available Polymarket subgraphs), and includes additional details (descriptions and key entities). It effectively distinguishes from siblings like get_subgraph_schema, which likely deals with schema details, and query_subgraph for executing queries.

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 listing all subgraphs but provides no explicit guidance on when to use this vs. alternatives like get_subgraph_schema. It does not mention when not to use it or any prerequisites.

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/PaulieB14/graph-polymarket-mcp'

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