Skip to main content
Glama
yigitabi5444

Polymarket MCP Server

by yigitabi5444

get_events

List and filter Polymarket prediction events with pagination, sorting, and status/tag filtering to analyze market data.

Instructions

List and filter Polymarket prediction events. Supports pagination, sorting, and filtering by status/tag.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of results to return
offsetNoPagination offset
orderNoSort field: volume, liquidity, startDate, endDate, createdAt
ascendingNoSort ascending (default: false)
slugNoFilter by event slug
tagNoFilter by tag label
closedNoFilter by closed status
activeNoFilter by active status

Implementation Reference

  • Tool handler implementation for 'get_events' in src/tools/gamma/events.ts, which calls the underlying GammaApi.getEvents method.
    async (args) => {
      try {
        const data = await gamma.getEvents(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 'get_events' tool including Zod schema validation in src/tools/gamma/events.ts.
    server.tool(
      "get_events",
      "List and filter Polymarket prediction events. Supports pagination, sorting, and filtering by status/tag.",
      {
        limit: z.number().min(1).max(100).default(20).describe("Number of results to return"),
        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 event slug"),
        tag: z.string().optional().describe("Filter by tag label"),
        closed: z.boolean().optional().describe("Filter by closed status"),
        active: z.boolean().optional().describe("Filter by active status"),
      },
  • The underlying GammaApi method 'getEvents' that executes the request logic for the 'get_events' tool.
    async getEvents(params?: {
      limit?: number;
      offset?: number;
      order?: string;
      ascending?: boolean;
      slug?: string;
      tag?: string;
      closed?: boolean;
      active?: boolean;
      archived?: boolean;
    }): Promise<GammaEvent[]> {
      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?.archived !== undefined) query.archived = String(params.archived);
      return this.client.gamma<GammaEvent[]>("/events", query);
    }

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