Skip to main content
Glama

prediction_markets_trending_topics

Identify trending topics from Polymarket prediction markets based on 24-hour volume for portfolio sentiment analysis. Use retrieved topic slugs to fetch related markets for deeper insights.

Instructions

Use when analysing a user’s portfolio and you need external sentiment from prediction markets.

Retrieves today’s trending Polymarket topics (ordered by 24-hour volume). Pass any slug from this list to prediction_markets_markets_by_topic to pull the individual markets for that theme.

Returns

str A JSON array (string) of topic slugs ordered by 24-hour volume, e.g. '["Trump-Presidency", "Oil-Prices", "Iran"]'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • main.py:8-25 (handler)
    The main handler function for the 'prediction_markets_trending_topics' tool. Decorated with @mcp.tool, it calls the helper poly.trending() to fetch trending topics and serializes the result as a JSON string.
    @mcp.tool
    async def prediction_markets_trending_topics() -> str:
        """
        Use when analysing a user’s portfolio and you need external sentiment from
        prediction markets.
    
        Retrieves today’s trending Polymarket topics (ordered by 24-hour volume).
        Pass any slug from this list to `prediction_markets_markets_by_topic`
        to pull the individual markets for that theme.
    
        Returns
        -------
        str
            A JSON array (string) of topic slugs ordered by 24-hour volume, e.g.
            '["Trump-Presidency", "Oil-Prices", "Iran"]'.
        """
        return json.dumps(await poly.trending())
  • Supporting utility function 'trending()' that performs web scraping on Polymarket.com using Playwright to extract the list of current trending topic slugs.
    async def trending() -> list[str]:
        async with async_playwright() as p:
            browser = await p.chromium.launch(headless=True)
            page = await browser.new_page()
            await page.goto("https://polymarket.com", wait_until="domcontentloaded")
            await page.wait_for_selector("div[role='tablist'] button[role='tab']")
            topics = await page.locator(
                "div[role='tablist'] button[role='tab']"
            ).all_inner_texts()
            await browser.close()
            return [t.strip() for t in topics if t.strip() != "All"]
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains the tool's behavior: retrieving trending topics ordered by 24-hour volume and returning a JSON array string. However, it doesn't mention rate limits, authentication requirements, data freshness, or error conditions. The description adds some value but lacks comprehensive behavioral context.

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 well-structured and appropriately sized. It begins with usage guidance, states the core functionality, explains the sibling tool relationship, and clearly documents the return format. Every sentence earns its place with no wasted words. The Returns section is properly formatted and informative.

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 simplicity (zero parameters, no output schema, no annotations), the description provides adequate context. It explains what the tool does, when to use it, how to use the output with sibling tools, and the return format. For a straightforward read-only tool, this is reasonably complete, though it could benefit from mentioning data source limitations or update frequency.

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 with 100% schema description coverage. The description appropriately doesn't discuss parameters since none exist. It does mention the output format, which is helpful context. Baseline for zero parameters is 4, and the description meets this standard.

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's purpose: retrieving today's trending Polymarket topics ordered by 24-hour volume. It specifies the verb ('retrieves'), resource ('trending Polymarket topics'), and ordering criterion. However, it doesn't explicitly differentiate from sibling tools like 'search_prediction_markets' beyond mentioning one specific follow-up action.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance: 'Use when analysing a user's portfolio and you need external sentiment from prediction markets.' It also specifies when to use a sibling tool: 'Pass any slug from this list to `prediction_markets_markets_by_topic` to pull the individual markets for that theme.' This clearly defines the context and alternative workflow.

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

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