Skip to main content
Glama
hmumixaM

USCardForum MCP Server

by hmumixaM

get_hot_topics

Fetch trending discussions from USCardForum to identify actively debated topics, breaking news, and time-sensitive opportunities based on community engagement metrics.

Instructions

Fetch currently trending/hot topics from USCardForum.

This returns the most actively discussed topics right now, ranked by
engagement metrics like recent replies, views, and likes.

Use this to:
- See what the community is currently discussing
- Find breaking news or time-sensitive opportunities
- Discover popular ongoing discussions

Args:
    page: Page number for pagination (0-indexed). Use page=1 to get more topics.

Returns a list of TopicSummary objects with fields:
- id: Topic ID (use with get_topic_posts)
- title: Topic title
- posts_count: Total replies
- views: View count
- like_count: Total likes
- created_at: Creation timestamp
- last_posted_at: Last activity timestamp

Example response interpretation:
A topic with high views but low posts may be informational.
A topic with many recent posts is actively being discussed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination (0-indexed, default: 0)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The MCP tool handler for get_hot_topics, decorated with @mcp.tool(). Delegates to DiscourseClient.get_hot_topics() to fetch trending topics.
    @mcp.tool()
    def get_hot_topics(
        page: Annotated[
            int | None,
            Field(default=None, description="Page number for pagination (0-indexed, default: 0)"),
        ] = None,
    ) -> list[TopicSummary]:
        """
        Fetch currently trending/hot topics from USCardForum.
    
        This returns the most actively discussed topics right now, ranked by
        engagement metrics like recent replies, views, and likes.
    
        Use this to:
        - See what the community is currently discussing
        - Find breaking news or time-sensitive opportunities
        - Discover popular ongoing discussions
    
        Args:
            page: Page number for pagination (0-indexed). Use page=1 to get more topics.
    
        Returns a list of TopicSummary objects with fields:
        - id: Topic ID (use with get_topic_posts)
        - title: Topic title
        - posts_count: Total replies
        - views: View count
        - like_count: Total likes
        - created_at: Creation timestamp
        - last_posted_at: Last activity timestamp
    
        Example response interpretation:
        A topic with high views but low posts may be informational.
        A topic with many recent posts is actively being discussed.
        """
        return get_client().get_hot_topics(page=page)
  • Pydantic model defining the TopicSummary return type for get_hot_topics tool.
    class TopicSummary(BaseModel):
        """Summary of a topic for list views (hot, new, top topics)."""
    
        id: int = Field(..., description="Unique topic identifier")
        title: str = Field(..., description="Topic title")
        posts_count: int = Field(0, description="Total number of posts")
        views: int = Field(0, description="Total view count")
        like_count: int = Field(0, description="Total likes on the topic")
        category_id: int | None = Field(None, description="Category identifier")
        category_name: str | None = Field(None, description="Category name")
        created_at: datetime | None = Field(None, description="When topic was created")
        last_posted_at: datetime | None = Field(None, description="Last activity time")
    
        class Config:
            extra = "ignore"
  • Import statement in MCP server entrypoint that registers get_hot_topics by importing it into the mcp namespace.
    from uscardforum.server_tools import (
        analyze_user,
        bookmark_post,
        compare_cards,
        find_data_points,
        get_all_topic_posts,
        get_categories,
        get_current_session,
        get_hot_topics,
        get_new_topics,
        get_notifications,
        get_top_topics,
        get_topic_info,
        get_topic_posts,
        get_user_actions,
        get_user_badges,
        get_user_followers,
        get_user_following,
        get_user_reactions,
        get_user_replies,
        get_user_summary,
        get_user_topics,
        list_users_with_badge,
        login,
        research_topic,
        resource_categories,
        resource_hot_topics,
        resource_new_topics,
        search_forum,
        subscribe_topic,
    )
  • DiscourseClient method that wraps TopicsAPI.get_hot_topics and enriches with category names.
    def get_hot_topics(self, *, page: int | None = None) -> list[TopicSummary]:
        """Fetch currently hot/trending topics.
    
        Args:
            page: Page number for pagination (0-indexed, default: 0)
    
        Returns:
            List of hot topic summaries
        """
        topics = self._topics.get_hot_topics(page=page)
        return self._enrich_with_categories(topics)
  • TopicsAPI method that performs the HTTP GET request to /hot.json and parses into TopicSummary objects.
    def get_hot_topics(self, *, page: int | None = None) -> list[TopicSummary]:
        """Fetch currently trending topics.
    
        Args:
            page: Page number for pagination (0-indexed, default: 0)
    
        Returns:
            List of hot topic summaries
        """
        params: dict[str, Any] = {}
        if page is not None:
            params["page"] = int(page)
    
        payload = self._get(
            "/hot.json",
            params=params or None,
            headers={"Accept": "application/json, text/plain, */*"},
        )
        topics = payload.get("topic_list", {}).get("topics", [])
        return [TopicSummary(**t) for t in topics]

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by explaining ranking methodology ('engagement metrics like recent replies, views, and likes'), pagination behavior, and response interpretation guidance. It doesn't mention rate limits or authentication requirements, but provides substantial behavioral context beyond basic functionality.

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 with clear sections: purpose statement, usage guidelines, parameters, return format, and interpretation examples. Every sentence adds value, there's no redundancy, and information is front-loaded with the core purpose stated immediately.

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

Completeness5/5

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

For a read-only tool with one parameter and an output schema, the description is complete. It explains what the tool does, when to use it, how results are ranked, includes parameter guidance, documents the return structure, and provides interpretation examples - covering all necessary context despite having no annotations.

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 'page' fully documented in the schema. The description adds minimal value beyond the schema by mentioning 'Use page=1 to get more topics' which slightly clarifies usage but doesn't add significant semantic meaning. Baseline 3 is appropriate when schema does the heavy lifting.

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 specific action ('fetch trending/hot topics'), identifies the resource ('from USCardForum'), and distinguishes it from siblings by specifying it returns 'most actively discussed topics right now, ranked by engagement metrics' - differentiating it from tools like get_new_topics, get_top_topics, or get_categories.

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 scenarios with three bullet points explaining when to use this tool ('See what the community is currently discussing', 'Find breaking news or time-sensitive opportunities', 'Discover popular ongoing discussions'), giving clear context for when this tool is appropriate versus alternatives.

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