Skip to main content
Glama
PaulieB14

graph-polymarket-mcp

get_polymarket_event

Retrieve a specific Polymarket event including all its associated prediction markets using the event ID or slug.

Instructions

Get a single Polymarket event with all its associated markets. An event groups related prediction markets under one topic.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
eventIdYesEvent ID or slug

Implementation Reference

  • The actual implementation of getEvent() - calls the Gamma API endpoint /events/{eventId} to fetch a single Polymarket event with all its associated markets.
    export async function getEvent(eventId: string): Promise<GammaEvent> {
      return fetchJson<GammaEvent>(`${GAMMA_BASE}/events/${encodeURIComponent(eventId)}`);
    }
  • src/index.ts:1099-1116 (registration)
    Tool registration for 'get_polymarket_event' with input schema (eventId: string) and handler that calls getEvent(eventId) from polymarketApi.ts.
    server.registerTool(
      "get_polymarket_event",
      {
        description:
          "Get a single Polymarket event with all its associated markets. An event groups related prediction markets under one topic.",
        inputSchema: {
          eventId: z.string().describe("Event ID or slug"),
        },
      },
      async ({ eventId }) => {
        try {
          const event = await getEvent(eventId);
          return textResult(event);
        } catch (error) {
          return errorResult(error);
        }
      }
    );
  • GammaEvent interface defining the shape of the event object returned by getEvent - includes id, slug, title, description, startDate, endDate, and nested markets array.
    export interface GammaEvent {
      id: string;
      slug: string;
      title: string;
      description: string;
      startDate: string;
      endDate: string;
      markets: GammaMarket[];
      [key: string]: unknown;
    }
  • fetchJson helper used by getEvent to make the HTTP request and parse JSON.
    async function fetchJson<T>(url: string): Promise<T> {
      const response = await fetch(url, {
        headers: { Accept: "application/json" },
      });
      if (!response.ok) {
        throw new PolymarketApiError(
          `HTTP ${response.status}: ${response.statusText}`,
          response.status,
          url
        );
      }
      return response.json() as Promise<T>;
    }
Behavior2/5

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

No annotations are provided, so the description must carry the full burden. It states the tool 'gets' data, but does not disclose behavioral traits such as whether the eventId can be a slug, the structure of the returned markets, data freshness, or any side effects. The description adds minimal value beyond the tool name.

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 very concise: two sentences, front-loaded with the core purpose, and the second sentence provides essential context about what an event is. No extraneous words or repetition.

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 the lack of output schema and annotations, the description is adequate but not comprehensive. It explains that the event comes 'with all its associated markets,' but does not specify the format or structure of those markets. For a tool with many siblings, more detail on what 'associated markets' entails would improve completeness.

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 input schema describes the only parameter 'eventId' as 'Event ID or slug' with 100% coverage. The description offers no additional meaning beyond the schema, so the baseline score of 3 is appropriate. No extra value is added.

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 tool's purpose: 'Get a single Polymarket event with all its associated markets.' It specifies the resource (event) and the action (get), and differentiates from sibling tools like list_polymarket_events (which lists multiple events) and get_market_* (which targets individual markets).

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 the tool is for retrieving a single event, but it does not provide explicit guidance on when to use it versus alternatives such as list_polymarket_events or get_market_info. No when-not-to-use or exclusion criteria are given, leaving the agent to infer usage from the name and brief description.

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