Skip to main content
Glama
yigitabi5444

Polymarket MCP Server

by yigitabi5444

get_market

Retrieve detailed information about a specific Polymarket prediction market, including outcomes, prices, volume, and liquidity data, using its ID or slug.

Instructions

Get a single Polymarket market by ID or slug. Returns full market details including outcomes, prices, volume, and liquidity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoMarket ID
slugNoMarket slug

Implementation Reference

  • Tool handler for "get_market", which delegates to GammaApi.getMarket.
      async (args) => {
        if (!args.id && !args.slug) {
          return {
            content: [{ type: "text", text: "Error: Either id or slug is required" }],
            isError: true,
          };
        }
        try {
          const data = await gamma.getMarket(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,
          };
        }
      },
    );
  • Registration of the "get_market" tool in the Gamma markets toolset.
    "get_market",
    "Get a single Polymarket market by ID or slug. Returns full market details including outcomes, prices, volume, and liquidity.",
    {
      id: z.string().optional().describe("Market ID"),
      slug: z.string().optional().describe("Market slug"),
  • API method that fetches a single market by ID or slug from the Gamma API.
    async getMarket(params: { id?: string; slug?: string }): Promise<GammaMarket> {
      if (params.id) {
        return this.client.gamma<GammaMarket>(
          `/markets/${params.id}`,
          undefined,
          CACHE_TTLS.marketById,
        );
      }
      const results = await this.client.gamma<GammaMarket[]>("/markets", {
        slug: params.slug,
      });
      if (!results || results.length === 0) {
        throw new Error(`Market not found: ${params.slug}`);
      }
      return results[0];
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states it 'Returns full market details including outcomes, prices, volume, and liquidity'. It misses behavioral traits like whether it's read-only (implied but not stated), error handling for invalid IDs, rate limits, or authentication needs. This is inadequate for a tool with no annotation coverage.

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 a single, efficient sentence that front-loads the purpose and key details. It avoids redundancy, but could be slightly more structured by separating usage context from return details. Overall, it's concise with minimal waste.

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?

Given no annotations and no output schema, the description provides basic purpose and return details but lacks completeness. It doesn't cover error cases, response format beyond a list of fields, or how to handle the optional parameters (id vs slug). For a tool with 2 parameters and rich sibling tools, more context is needed.

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?

Schema description coverage is 100%, so the schema already documents 'id' and 'slug' parameters. The description adds no additional meaning beyond implying these are identifiers for fetching a market, matching the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

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 action ('Get') and resource ('a single Polymarket market'), specifying it's by 'ID or slug'. It distinguishes from sibling tools like 'get_markets' (plural) by focusing on a single market. However, it doesn't explicitly contrast with 'get_clob_market' or other specific siblings, keeping it at 4 rather than 5.

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 by mentioning 'by ID or slug', but lacks explicit guidance on when to use this versus alternatives like 'get_markets' for multiple markets or 'get_clob_market' for CLOB-specific data. No exclusions or prerequisites are stated, leaving usage context partially inferred.

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