Skip to main content
Glama
berlinbra

PolyMarket MCP Server

get-market-info

Retrieve detailed data on a specific prediction market using a market ID or slug. This tool integrates with the PolyMarket API to provide accurate market insights, including pricing and historical trends.

Instructions

Get detailed information about a specific prediction market

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
market_idYesMarket ID or slug

Implementation Reference

  • Handler implementation for the 'get-market-info' tool. Extracts the market_id argument, fetches market data using the ClobClient, formats it using format_market_info helper, and returns the result as text content.
    if name == "get-market-info":
        market_id = arguments.get("market_id")
        if not market_id:
            return [types.TextContent(type="text", text="Missing market_id parameter")]
        
        market_data = client.get_market(market_id)
        formatted_info = format_market_info(market_data)
        return [types.TextContent(type="text", text=formatted_info)]
  • JSON Schema defining the input for the 'get-market-info' tool, requiring a 'market_id' string parameter.
    inputSchema={
        "type": "object",
        "properties": {
            "market_id": {
                "type": "string",
                "description": "Market ID or slug",
            },
        },
        "required": ["market_id"],
    },
  • Registration of the 'get-market-info' tool within the @server.list_tools() handler, specifying name, description, and input schema.
    types.Tool(
        name="get-market-info",
        description="Get detailed information about a specific prediction market",
        inputSchema={
            "type": "object",
            "properties": {
                "market_id": {
                    "type": "string",
                    "description": "Market ID or slug",
                },
            },
            "required": ["market_id"],
        },
    ),
  • Helper function that formats the raw market data dictionary into a human-readable string summary, extracting key fields like condition_id, title, status, and resolution_date.
    def format_market_info(market_data: dict) -> str:
        """Format market information into a concise string."""
        try:
            if not market_data or not isinstance(market_data, dict):
                return "No market information available"
                
            condition_id = market_data.get('condition_id', 'N/A')
            title = market_data.get('title', 'N/A')
            status = market_data.get('status', 'N/A')
            resolution_date = market_data.get('resolution_date', 'N/A')
                
            return (
                f"Condition ID: {condition_id}\n"
                f"Title: {title}\n"
                f"Status: {status}\n"
                f"Resolution Date: {resolution_date}\n"
                "---"
            )
        except Exception as e:
            return f"Error formatting market data: {str(e)}"
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool retrieves 'detailed information' but doesn't specify what that includes (e.g., market status, participants, outcomes), whether it's read-only (implied by 'Get'), or any behavioral traits like rate limits, authentication needs, or error handling.

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, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple tool with one parameter and is front-loaded with the core action.

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?

Given no annotations and no output schema, the description is incomplete. It doesn't explain what 'detailed information' entails, the return format, or how this tool fits with siblings. For a tool that likely returns complex market data, more context is needed to guide effective use.

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 the single parameter 'market_id' documented as 'Market ID or slug'. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or valid slug patterns, so it meets the baseline for high schema coverage.

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 resource ('detailed information about a specific prediction market'), making the purpose unambiguous. However, it doesn't explicitly differentiate from siblings like 'get-market-history' or 'get-market-prices', which likely provide different types of market data.

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 provides no guidance on when to use this tool versus alternatives like 'list-markets' or 'get-market-history'. It doesn't specify prerequisites, such as needing a market ID, or contextual factors like whether this is for real-time data or historical analysis.

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

Related 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/berlinbra/polymarket-mcp'

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