Skip to main content
Glama
Mavline

Polymarket Gamma MCP Server

by Mavline

Polymarket Gamma MCP Server

MCP Server for working with the Polymarket Gamma Markets API - retrieving prediction market data, events, and analytics.

🚀 Features

📊 Core functions:

  • Trending markets - get popular markets with high volume

  • Market search - search by text in questions and descriptions

  • Category filtering - markets by tags (Politics, Sports, Crypto)

  • Market details - full information about a specific market

  • Events - get events with related markets

  • API Usage - track request usage

🔧 Technical features:

  • No API keys - public access to the Gamma API

  • TypeScript - strict typing and data validation

  • Retry logic - automatic retries on network errors

  • Formatted output - convenient data display in Russian

  • Limit tracking - API usage monitoring

Related MCP server: Polymarket MCP Server

📦 Installation

# Клонировать и установить зависимости
npm install

# Собрать проект
npm run build

# Запустить тесты
npm test

🛠️ Available tools

1. get_trending_markets

Get trending markets with high trading volume.

Parameters:

  • limit (number, default: 20) - number of markets

Example response:

{
  "summary": "Найдено 5 трендовых рынков",
  "apiUsage": "4/1000 запросов использовано, 996 осталось",
  "markets": "1. Will Joe Biden get Coronavirus before the election?\n   💰 Объём: $32,257 | 💧 Ликвидность: $0\n   🏷️ Теги: US-current-affairs\n   📊 Цены: Yes: 0.0% | No: 0.0%",
  "rawData": [...]
}

2. get_markets_by_category

Get markets by categories/tags.

Parameters:

  • tags (array of strings, required) - categories for filtering

  • limit (number, default: 50) - number of markets

Example:

{
  "tags": ["Politics", "US Election"],
  "limit": 20
}

3. search_markets

Search markets by text query.

Parameters:

  • query (string, required) - search query

  • limit (number, default: 30) - number of results

4. get_market_details

Get detailed information about a specific market.

Parameters:

  • marketId (string, required) - market ID

5. get_events

Get events with related markets.

Parameters:

  • limit (number, default: 20) - number of events

  • active (boolean, default: true) - only active events

  • orderBy (string) - sorting: volume, liquidity, endDate, createdAt

6. get_event_details

Get detailed information about an event.

Parameters:

  • eventId (string, required) - event ID

7. get_api_usage

Get API usage statistics.

🔗 API Endpoints

The server uses the following Gamma API endpoints:

  • GET /markets - list of markets

  • GET /markets/{id} - market details

  • GET /events - list of events

  • GET /events/{id} - event details

Base URL: https://gamma-api.polymarket.com

📊 Data structure

ProcessedMarket

{
  id: string;
  question: string;
  description?: string;
  outcomes: string[];
  prices: number[];
  volume: number;
  liquidity: number;
  endDate: string;
  tags: string[];
  active: boolean;
  closed: boolean;
  resolved: boolean;
  negRisk: boolean;
  spread?: number;
  slug: string;
  tokens: Array<{
    id: string;
    outcome: string;
    price: number;
    winner?: boolean;
  }>;
}

ProcessedEvent

{
  id: string;
  title: string;
  description?: string;
  slug: string;
  tags: string[];
  startDate?: string;
  endDate?: string;
  active: boolean;
  closed: boolean;
  volume?: number;
  liquidity?: number;
  marketsCount: number;
  topMarkets?: ProcessedMarket[];
}

🧪 Testing

# Основные тесты
npm test

# Отладка API структуры
node test/debug-api.js

⚠️ Limitations

  1. Public API - no keys, but with reasonable limits

  2. Read-only - cannot place orders (requires CLOB API)

  3. Simplified search - no full-text search yet

  4. Delayed data - not real-time quotes

🔄 Windsurf Integration

Add to mcp_config.json:

{
  "mcpServers": {
    "polymarket-gamma": {
      "command": "node",
      "args": ["C:/Users/pavelk/Desktop/Projects/my_own/Bet/polymarket/mcp-servers/polymarket-gamma-server/dist/index.js"],
      "cwd": "C:/Users/pavelk/Desktop/Projects/my_own/Bet/polymarket/mcp-servers/polymarket-gamma-server"
    }
  }
}

📈 Usage

This server is ideal for:

  • Market analytics - researching trends and volumes

  • Event monitoring - tracking new markets

  • Research - collecting data for analysis

  • Opportunity screening - finding interesting markets

For real trading, use a separate CLOB MCP Server.

🚀 Next steps

  1. Gamma API Server - ready and tested

  2. 🔄 CLOB API Server - for trading operations

  3. 🔄 WebSocket Server - for real-time data

  4. 🔄 Unified Server - combining all capabilities

Available Tools

8 tools
get_api_usageA

Get current API usage statistics and rate limits

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description must disclose behavioral traits. It implies a read-only operation via 'Get' but does not explicitly state safety, side effects, or any limits. It is adequate for a simple getter but lacks explicit reassurance beyond the verb.

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, clear sentence with no redundant words. It front-loads the action and resource, making it efficient and easy to parse.

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?

For a zero-parameter tool with no annotations or output schema, the description states the core functionality. However, it does not elaborate on the exact nature of the statistics or the structure of the response, which could be useful. It is mostly complete but leaves some ambiguity.

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 tool has zero parameters, so the description does not need to add parameter meaning. Baseline for 0 params is 4, and the description mentions 'statistics and rate limits' which hints at the data returned, not parameters. This 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 uses a specific verb ('Get') and clearly names the resource ('API usage statistics and rate limits'). It differentiates from sibling tools focused on market/event data, and the tool name reinforces the purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool relative to alternatives or any context about typical use cases (e.g., checking quota before requests). The description only states what it does, not when it should be invoked.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_event_detailsA

Get detailed information about a specific event by ID

ParametersJSON Schema
NameRequiredDescriptionDefault
eventIdYesUnique event ID

TDQS

A3.8/5.0
Behavior2/5

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

No annotations are present, so the description must carry the full burden of behavioral disclosure. It only states the action and does not mention that the operation is read-only, what happens if the event ID is invalid or not found, or any error behavior. While the name implies a read operation, the description lacks explicit transparency about side effects (or lack thereof).

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 zero filler. It front-loads the action and resource, making it instantly parseable. There is no wasted text.

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 tool's low complexity (one required parameter, no nested objects, no output schema), the description is sufficient to convey the tool's purpose. It does not explain return format, but the absence of an output schema lowers the expectation. Overall, the description covers what is needed for this simple tool.

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 already fully describes the single parameter 'eventId' as 'Unique event ID' (100% coverage). The description does not add any additional meaning or usage details beyond the schema, so a baseline score of 3 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 ('Get') and the resource ('detailed information about a specific event') with the criterion 'by ID'. This distinguishes it from sibling tools like get_events (which lists events) and get_market_details (which focuses on markets).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the appropriate use case: when you have a specific event ID and need detailed information. It does not explicitly name alternatives or state 'use this instead of get_events', but the context is clear enough for an agent to infer when to invoke it. No exclusions are mentioned, but the guidance is adequate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_eventsB

Get events with their associated markets

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of events to return (default: 20)
activeNoFilter for active events only (default: true)
orderByNoSort events by field (default: volume)volume

TDQS

B3.3/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. The verb 'Get' implies a read-only operation, but the description does not explicitly state side effects, permissions, or any constraints. It is adequate but not detailed.

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 that effectively communicates the core functionality without unnecessary words or preamble.

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?

The description explains that events come with associated markets, which provides some context. However, it does not mention return format, pagination, or any caveats. For a simple retrieval tool, it is moderately complete but could be more informative.

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 covers all three parameters with descriptions (limit, active, orderBy), so coverage is 100%. The tool description adds no extra meaning beyond the schema, but the parameter descriptions are sufficient, so a baseline score of 3 is appropriate.

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 verb 'Get' and the resource 'events', with the additional detail of including 'associated markets', which distinguishes it from sibling tools like get_trending_markets or get_sports_events. It is specific enough to understand the tool's function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not mention when to use this tool versus alternatives. It lacks guidance on when this is preferred over other event-related tools, so the agent has to infer from the name and parameters.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_market_detailsB

Get detailed information about a specific market by ID

ParametersJSON Schema
NameRequiredDescriptionDefault
marketIdYesUnique market ID

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are provided, so the description must disclose behavior on its own. It only says 'detailed information' without specifying what fields are returned, whether the operation is read-only, or what happens for invalid IDs. The safety profile of a get operation is somewhat implied, but the burden is not fully met.

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 clear sentence with no wasted words. It is front-loaded and immediately communicates the core purpose.

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

Completeness2/5

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

With no output schema and no annotations, the description's mention of 'detailed information' is vague. The agent is left without knowledge of the return structure or edge-case behavior, which matters for a tool that is meant to provide details.

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% with 'Unique market ID' documenting the parameter. The description adds no extra meaning beyond echoing 'by ID', so it meets the baseline but does not enhance understanding of the parameter's format or constraints.

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 (get), the resource (detailed information about a market), and the specific scope (by ID). It distinguishes this tool from sibling tools like get_trending_markets or search_markets by emphasizing the ID-based lookup.

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 when a specific market ID is known and detailed information is needed, but it does not explicitly mention when not to use it or provide alternatives. No exclusions or comparisons to sibling tools are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_markets_by_categoryA

Get markets filtered by category/tags (Politics, Sports, Crypto, etc.)

ParametersJSON Schema
NameRequiredDescriptionDefault
tagsYesCategory tags to filter by (e.g., ["Politics", "US Election"])
limitNoNumber of markets to return (default: 50)

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It indicates a read operation ('Get') but does not disclose how the filtering works (e.g., match all vs any tags), return format, pagination, or sorting behavior. This leaves significant behavioral ambiguity.

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, front-loaded sentence that immediately states the purpose. It wastes no words and is appropriately sized for a filtered-list tool.

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?

This is a low-complexity tool with full schema coverage for both parameters, so the core functionality is described. However, the lack of behavioral details (like tag matching semantics, return shape, or pagination) and the absence of annotations keep it from being fully complete.

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 already describes both parameters with 100% coverage, so the description adds little beyond example tags. The description's examples of categories (Politics, Sports, Crypto) give a flavor of valid values but do not add deeper meaning beyond what the schema provides.

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 identifies a verb ('Get'), a resource ('markets'), and a specific filter dimension ('category/tags'). Examples of categories (Politics, Sports, Crypto) distinguish this tool from siblings like search_markets or get_trending_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 should be used when filtering markets by category/tags, but it does not explicitly state when to prefer this over alternatives or when not to use it. No exclusions or alternative tool names are mentioned, leaving the usage context only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_sports_eventsC

Получить спортивные события с Polymarket (ПРАВИЛЬНЫЕ параметры)

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoКоличество событий (default: 25)

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries full responsibility for behavioral disclosure, but it only says 'Get' implying a read operation. It does not mention auth requirements, rate limits, output format, or any side effects. The parenthetical about 'correct parameters' is vague and adds no behavioral clarity.

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 one short sentence, front-loaded with the core purpose. However, the parenthetical '(CORRECT parameters)' is unclear and adds noise, slightly reducing clarity. Still, it is concise and to the point.

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

Completeness2/5

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

The tool is simple with one parameter and no output schema, but the description is minimal and does not explain what constitutes sports events, how they relate to other market tools, or what the response looks like. The ambiguous parenthetical further detracts from 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?

Schema coverage is 100% and the single 'limit' parameter is described in the schema. The description adds no additional meaning beyond the schema, which is acceptable but does not enhance the agent's understanding of how the parameter behaves in context.

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 retrieves sports events from Polymarket, which is a specific verb+resource. However, it does not distinguish itself from sibling tools like get_events, and the parenthetical '(CORRECT parameters)' adds ambiguity rather than clarity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like get_events or search_markets. The description does not mention any context, prerequisites, or exclusions, leaving the agent without direction on tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_marketsA

Search markets by text query in question/description

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of results to return (default: 30)
queryYesSearch query text

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It adds a useful detail about searching within question/description fields, but it does not disclose any quirks, result ordering, pagination behavior, or whether it's a read-only operation. This is adequate but not thorough.

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 that conveys the essential purpose without any fluff or repetition. It is front-loaded and easy to parse.

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?

For a simple search tool with only two parameters and no output schema, the description is sufficient. It explains what fields are searched and the schema covers the limit parameter. It does not need to enumerate return values since no output schema exists, and the tool's behavior is straightforward.

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 schema provides 100% coverage for both `query` and `limit` with descriptive text. The description adds extra semantics by specifying that the search applies to 'question/description', which clarifies the scope of the query parameter beyond the schema's generic 'Search query text'.

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 action ('Search'), the resource ('markets'), and the specific mechanism ('by text query in question/description'). This distinguishes it from sibling tools like get_markets_by_category or get_trending_markets, which retrieve markets through different criteria.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies this tool is for free-text searching within market questions/descriptions, which provides clear context for when to use it. However, it does not explicitly mention alternatives or when not to use this tool, so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 8 tool updatesv1.0.0
    • First observedget_api_usage
    • First observedget_event_details
    • First observedget_events
    • First observedget_market_details
    • First observedget_markets_by_category
    • First observedget_sports_events
    • First observedget_trending_markets
    • First observedsearch_markets

TDQS

A3.7/5.0
Disambiguation4/5

Most tools are distinct: trending, category, search, details, events, event details, API usage. However, get_events and get_sports_events overlap somewhat, though the descriptions clarify sports is a subset. Search and category are clearly different. Overall, boundaries are mostly clear.

Naming Consistency5/5

All tools follow the consistent pattern of 'get_' + noun, with clear nouns like 'trending_markets', 'market_details', 'events', etc. No mixed conventions or unexpected verbs.

Tool Count5/5

8 tools are well-scoped for a read-only market data server. Each covers a distinct query type, and none feel redundant or excessive.

Completeness4/5

The surface covers market retrieval (trending, by category, search), market details, event listings and details, and API usage. Minor gaps like historical price data or market resolution info exist, but core read-only workflows are complete.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables access to Polymarket's prediction markets for analyzing market probabilities, trading activity, and event outcomes across politics, sports, crypto, and other categories through natural language queries.
    37
    10
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to query Polymarket prediction markets, accessing real-time odds, market data, price history, order books, and trending markets across categories like politics, crypto, and sports through natural language.
    37
    5
    MIT
  • A
    license
    B
    quality
    D
    maintenance
    Enables comprehensive read access to Polymarket prediction market data, including live prices, order books, and market statistics. It allows AI assistants to analyze events, search markets, and monitor real-time signals without requiring API keys or authentication.
    22
    1
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables interaction with Polymarket prediction markets through read-only access to market data, events, orderbooks, and user positions, plus authenticated trading capabilities for creating and managing orders.
    1
    -

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/Mavline/polymarket-gamma-server'

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