get_new_topics
Fetch recently created topics from USCardForum to discover fresh deals, community questions, and emerging discussions before they gain popularity.
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
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination (0-indexed, default: 0) |
Implementation Reference
- The primary MCP tool handler for 'get_new_topics', decorated with @mcp.tool(). Defines input schema via Annotated Field and comprehensive docstring. Delegates execution to the DiscourseClient instance.@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)
- src/uscardforum/server.py:23-25 (registration)Explicit import and re-export of get_new_topics in the main server.py module, making it available for the MCP server entrypoint.get_hot_topics, get_new_topics, get_notifications,
- src/uscardforum/server_tools/__init__.py:25-25 (registration)Package-level import of the get_new_topics tool from the topics submodule for unified server_tools interface.from .topics import get_hot_topics, get_new_topics, get_top_topics
- src/uscardforum/api/topics.py:45-64 (helper)Core helper function in TopicsAPI that performs the HTTP request to /latest.json endpoint to retrieve new topics and parses into TopicSummary models.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]
- src/uscardforum/client.py:173-183 (helper)Client wrapper that calls the API layer and enriches topics with category names.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)