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"]
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