Skip to main content
Glama
yigitabi5444

Polymarket MCP Server

by yigitabi5444

get_markets

Retrieve and filter Polymarket prediction markets by volume, liquidity, dates, tags, and status to identify trading opportunities.

Instructions

List and filter Polymarket prediction markets. Supports rich filtering by volume, liquidity, dates, tags, and status. Sort by volume descending to find the most active markets.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of results
offsetNoPagination offset
orderNoSort field: volume, liquidity, startDate, endDate, createdAt
ascendingNoSort ascending (default: false)
slugNoFilter by market slug
tagNoFilter by tag label (e.g. 'politics', 'crypto')
closedNoFilter by closed status
activeNoFilter by active status
liquidity_minNoMinimum liquidity (USD)
liquidity_maxNoMaximum liquidity (USD)
volume_minNoMinimum volume (USD)
volume_maxNoMaximum volume (USD)
start_date_minNoMinimum start date (ISO format)
start_date_maxNoMaximum start date (ISO format)
end_date_minNoMinimum end date (ISO format)
end_date_maxNoMaximum end date (ISO format)

Implementation Reference

  • The handler for the 'get_markets' tool which calls the Gamma API.
    async (args) => {
      try {
        const data = await gamma.getMarkets(args);
        return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Error: ${(error as Error).message}` }],
          isError: true,
        };
      }
    },
  • The actual implementation of the getMarkets API method.
    async getMarkets(params?: {
      limit?: number;
      offset?: number;
      order?: string;
      ascending?: boolean;
      slug?: string;
      tag?: string;
      closed?: boolean;
      active?: boolean;
      liquidity_min?: number;
      liquidity_max?: number;
      volume_min?: number;
      volume_max?: number;
      start_date_min?: string;
      start_date_max?: string;
      end_date_min?: string;
      end_date_max?: string;
    }): Promise<GammaMarket[]> {
      const query: Record<string, string | undefined> = {};
      if (params?.limit !== undefined) query.limit = String(params.limit);
      if (params?.offset !== undefined) query.offset = String(params.offset);
      if (params?.order) query.order = params.order;
      if (params?.ascending !== undefined) query.ascending = String(params.ascending);
      if (params?.slug) query.slug = params.slug;
      if (params?.tag) query.tag = params.tag;
      if (params?.closed !== undefined) query.closed = String(params.closed);
      if (params?.active !== undefined) query.active = String(params.active);
      if (params?.liquidity_min !== undefined)
        query.liquidity_num_min = String(params.liquidity_min);
      if (params?.liquidity_max !== undefined)
        query.liquidity_num_max = String(params.liquidity_max);
      if (params?.volume_min !== undefined)
        query.volume_num_min = String(params.volume_min);
      if (params?.volume_max !== undefined)
        query.volume_num_max = String(params.volume_max);
      if (params?.start_date_min) query.start_date_min = params.start_date_min;
      if (params?.start_date_max) query.start_date_max = params.start_date_max;
      if (params?.end_date_min) query.end_date_min = params.end_date_min;
      if (params?.end_date_max) query.end_date_max = params.end_date_max;
      return this.client.gamma<GammaMarket[]>("/markets", query);
    }
  • The MCP tool registration for 'get_markets'.
    server.tool(
      "get_markets",
      "List and filter Polymarket prediction markets. Supports rich filtering by volume, liquidity, dates, tags, and status. Sort by volume descending to find the most active markets.",
      {
        limit: z.number().min(1).max(100).default(20).describe("Number of results"),
        offset: z.number().min(0).default(0).describe("Pagination offset"),
        order: z
          .string()
          .optional()
          .describe("Sort field: volume, liquidity, startDate, endDate, createdAt"),
        ascending: z.boolean().optional().describe("Sort ascending (default: false)"),
        slug: z.string().optional().describe("Filter by market slug"),
        tag: z.string().optional().describe("Filter by tag label (e.g. 'politics', 'crypto')"),
        closed: z.boolean().optional().describe("Filter by closed status"),
        active: z.boolean().optional().describe("Filter by active status"),
        liquidity_min: z.number().optional().describe("Minimum liquidity (USD)"),
        liquidity_max: z.number().optional().describe("Maximum liquidity (USD)"),
        volume_min: z.number().optional().describe("Minimum volume (USD)"),
        volume_max: z.number().optional().describe("Maximum volume (USD)"),
        start_date_min: z.string().optional().describe("Minimum start date (ISO format)"),
        start_date_max: z.string().optional().describe("Maximum start date (ISO format)"),
        end_date_min: z.string().optional().describe("Minimum end date (ISO format)"),
        end_date_max: z.string().optional().describe("Maximum end date (ISO format)"),
      },
      async (args) => {
        try {
          const data = await gamma.getMarkets(args);
          return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error: ${(error as Error).message}` }],
            isError: true,
          };
        }
      },
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions filtering and sorting capabilities but doesn't address important behavioral aspects like whether this is a read-only operation, potential rate limits, authentication requirements, pagination behavior beyond the schema parameters, or what format the results return. The description adds some context about filtering scope but leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise with two sentences that efficiently communicate core functionality. The first sentence establishes the main purpose and filtering capabilities, while the second provides a usage tip. There's no wasted verbiage, though it could be slightly more structured with clearer separation of filtering versus sorting information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 16 parameters, 100% schema coverage, but no annotations and no output schema, the description is minimally adequate. It covers the basic purpose and hints at usage but doesn't provide sufficient behavioral context for a complex filtering tool. The absence of output schema means the description should ideally address what kind of data is returned, but it doesn't.

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?

The schema description coverage is 100%, so the baseline is 3. The description adds marginal value by mentioning filtering by 'volume, liquidity, dates, tags, and status' which aligns with some parameters, and suggests sorting by 'volume descending' which relates to the 'order' and 'ascending' parameters. However, it doesn't provide additional semantic context beyond what's already documented in the comprehensive 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's purpose with 'List and filter Polymarket prediction markets', specifying both the action (list/filter) and resource (prediction markets). It distinguishes from some siblings like 'get_market' (singular) but doesn't explicitly differentiate from other listing tools like 'get_events' or 'search'.

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 provides implied usage guidance by mentioning 'rich filtering' capabilities and suggesting 'Sort by volume descending to find the most active markets'. However, it doesn't explicitly state when to use this tool versus alternatives like 'search', 'get_events', or 'get_sampling_markets', nor does it provide exclusion criteria.

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/yigitabi5444/yigit_polymarket_mcp'

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