Skip to main content
Glama
GodisinHisHeaven

USCardForum MCP Server

get_new_topics

Fetch recently created topics from USCardForum to find new deals, fresh questions, and emerging discussions before they become popular.

Instructions

Fetch the latest/newest topics from USCardForum.

Returns recently created topics sorted by creation time (newest first).
These may have fewer replies but contain fresh information.

Use this to:
- Find newly posted deals or offers
- See fresh questions from the community
- Discover emerging discussions before they get popular

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

Returns a list of TopicSummary objects with:
- id: Topic ID
- title: Topic title
- posts_count: Number of posts
- created_at: When the topic was created
- category_id: Which forum section it's in

Tip: New topics with high view counts may indicate important news.

Input Schema

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'get_new_topics' decorated with @mcp.tool(). Defines input schema via Annotated page parameter and detailed docstring. Executes tool logic by delegating to shared client instance's get_new_topics method, which fetches latest topics from the forum API.
    @mcp.tool()
    def get_new_topics(
        page: Annotated[
            int | None,
            Field(default=None, description="Page number for pagination (0-indexed, default: 0)"),
        ] = None,
    ) -> list[TopicSummary]:
        """
        Fetch the latest/newest topics from USCardForum.
    
        Returns recently created topics sorted by creation time (newest first).
        These may have fewer replies but contain fresh information.
    
        Use this to:
        - Find newly posted deals or offers
        - See fresh questions from the community
        - Discover emerging discussions before they get popular
    
        Args:
            page: Page number for pagination (0-indexed). Use page=1 to get more topics.
    
        Returns a list of TopicSummary objects with:
        - id: Topic ID
        - title: Topic title
        - posts_count: Number of posts
        - created_at: When the topic was created
        - category_id: Which forum section it's in
    
        Tip: New topics with high view counts may indicate important news.
        """
        return get_client().get_new_topics(page=page)
  • Imports the get_new_topics tool (line 24) along with all other MCP tools from server_tools package. Importing the decorated functions registers them with the FastMCP server instance.
    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,
    )
  • Shared helper function get_client() that returns the singleton DiscourseClient instance used by all MCP tools, including get_new_topics. Handles client creation, Cloudflare bypass, 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
  • Core API helper in TopicsAPI.get_new_topics() that performs the HTTP GET request to /latest.json endpoint, parses the JSON response, and constructs TopicSummary models from the raw topic data.
    def get_new_topics(self, *, page: int | None = None) -> list[TopicSummary]:
        """Fetch latest new topics.
    
        Args:
            page: Page number for pagination (0-indexed, default: 0)
    
        Returns:
            List of new topic summaries
        """
        params: dict[str, Any] = {}
        if page is not None:
            params["page"] = int(page)
    
        payload = self._get(
            "/latest.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]
  • DiscourseClient.get_new_topics() wrapper that delegates to TopicsAPI and enriches the returned TopicSummary list with category names using _enrich_with_categories method.
    def get_new_topics(self, *, page: int | None = None) -> list[TopicSummary]:
        """Fetch latest new topics.
    
        Args:
            page: Page number for pagination (0-indexed, default: 0)
    
        Returns:
            List of new topic summaries
        """
        topics = self._topics.get_new_topics(page=page)
        return self._enrich_with_categories(topics)
Behavior4/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 effectively describes key behaviors: it's a read-only fetch operation (implied by 'fetch' and 'returns'), returns sorted results (newest first), and notes that topics may have fewer replies. However, it lacks details on rate limits, authentication needs, or error handling, leaving some gaps.

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 front-loaded, starting with the core purpose, followed by usage guidelines, args, returns, and a tip. Each sentence adds meaningful information without redundancy, making it efficient and easy to parse for an AI agent.

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's low complexity (1 optional parameter), 100% schema coverage, and the presence of an output schema (detailed in the returns section), the description is complete. It covers purpose, usage, parameters, returns, and additional tips, leaving no significant gaps for the agent to operate effectively.

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 baseline is 3. The description adds value by explaining pagination semantics ('page=1 to get more topics') and providing a tip about high view counts, which offers context beyond the schema's technical details. This elevates the score above the baseline.

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 tool's purpose with specific verbs ('fetch', 'returns') and resources ('latest/newest topics from USCardForum'), distinguishing it from siblings like get_hot_topics or get_top_topics by emphasizing recency over popularity or ranking. It explicitly mentions sorting by creation time and targeting fresh information, making the distinction unambiguous.

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 ('Use this to:') with three concrete examples (finding deals, seeing fresh questions, discovering emerging discussions), clearly indicating when to use this tool. It also implicitly distinguishes from siblings by focusing on new topics rather than hot, top, or searched ones, though it doesn't name alternatives directly.

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

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