Skip to main content
Glama
rhettlong

USCardForum MCP Server

by rhettlong

get_hot_topics

Fetch trending discussions from USCardForum to identify active community conversations, breaking news, and time-sensitive opportunities based on 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

  • Primary MCP tool handler for get_hot_topics. Uses @mcp.tool() decorator for automatic registration and schema definition. Delegates execution to DiscourseClient via get_client() singleton.
    @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 output schema (list[TopicSummary]) for the 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"
  • Shared helper function providing singleton DiscourseClient instance, used by the tool handler. Handles client creation and optional auto-login.
    def get_client() -> DiscourseClient:
        """Get or create the Discourse client instance."""
        global _client, _login_attempted
    
        if _client is None:
            base_url = os.environ.get("USCARDFORUM_URL", "https://www.uscardforum.com")
            timeout = float(os.environ.get("USCARDFORUM_TIMEOUT", "15.0"))
            _client = DiscourseClient(base_url=base_url, timeout_seconds=timeout)
    
            # Auto-login if credentials are provided
            if not _login_attempted:
                _login_attempted = True
                username = os.environ.get("NITAN_USERNAME")
                password = os.environ.get("NITAN_PASSWORD")
    
                if username and password:
                    try:
                        result = _client.login(username, password)
                        if result.success:
                            print(f"[uscardforum] Auto-login successful as '{result.username}'")
                        elif result.requires_2fa:
                            print(
                                "[uscardforum] Auto-login failed: 2FA required. Use login() tool with second_factor_token."
                            )
                        else:
                            print(
                                f"[uscardforum] Auto-login failed: {result.error or 'Unknown error'}"
                            )
                    except Exception as e:  # pragma: no cover - logging side effect
                        print(f"[uscardforum] Auto-login error: {e}")
    
        return _client
  • Re-export of get_hot_topics from topics.py, ensuring the decorated tool is imported and registered when server_tools is imported.
    from .topics import get_hot_topics, get_new_topics, get_top_topics
  • Explicit import of get_hot_topics in the main server entrypoint, triggering decorator-based registration in FastMCP.
    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,
Behavior4/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. It discloses that the tool returns ranked results based on engagement metrics, includes pagination behavior (0-indexed, page=1 for more topics), and describes the return format with example interpretation. However, it doesn't mention rate limits, authentication requirements, or error conditions, leaving some behavioral aspects uncovered.

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, use cases, parameters, return format, and example interpretation. Every sentence adds value without redundancy, and it's front-loaded with the core functionality. The length is appropriate for the tool's complexity.

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?

Given the tool has an output schema (implied by the detailed return format description) and 100% schema coverage for its single parameter, the description is complete. It covers purpose, usage, parameters, return values, and behavioral context, leaving no significant gaps for an AI agent to understand and invoke the tool correctly.

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?

Schema description coverage is 100%, so the schema already documents the 'page' parameter. The description adds value by explaining the pagination logic ('0-indexed', 'Use page=1 to get more topics') and contextualizing it within the tool's purpose, though it doesn't provide additional syntax or format details beyond the schema.

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 verb 'fetch' and resource 'currently trending/hot topics from USCardForum', specifying the ranking criteria (engagement metrics like recent replies, views, and likes). It distinguishes from siblings like 'get_top_topics' or 'get_new_topics' by focusing on current trending/active discussions rather than all-time top or newly created topics.

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 explicitly provides three use cases ('See what the community is currently discussing', 'Find breaking news or time-sensitive opportunities', 'Discover popular ongoing discussions'), which clearly indicate when to use this tool. It implies alternatives by mentioning other tools like 'get_topic_posts' for detailed topic information, though it doesn't explicitly name all sibling tools.

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

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/rhettlong/uscardforum-mcp'

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