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
- MCP tool handler for get_new_topics. Decorated with @mcp.tool(), defines input schema via Annotated Field, includes detailed docstring, and delegates to DiscourseClient.get_new_topics()@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/api/topics.py:45-64 (helper)Low-level API implementation in TopicsAPI that performs HTTP GET to /latest.json, parses JSON response, and constructs TopicSummary objects.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)DiscourseClient wrapper method that calls TopicsAPI.get_new_topics() and enriches results 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)
- src/uscardforum/server.py:15-45 (registration)Explicit import of get_new_topics from server_tools, which triggers the @mcp.tool() registration when the server module is loaded.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, )