Skip to main content
Glama
rhettlong

USCardForum MCP Server

by rhettlong

get_user_topics

Retrieve topics created by a specific user on USCardForum to analyze their discussion contributions and identify areas of expertise.

Instructions

Fetch topics created by a specific user.

Args:
    username: The user's handle
    page: Page number for pagination (optional)

Returns a list of topic objects with:
- id: Topic ID
- title: Topic title
- posts_count: Number of replies
- views: View count
- created_at: When created
- category_id: Forum category

Use this to:
- See what discussions a user has initiated
- Find expert users in specific areas
- Research a user's areas of interest

Paginate by incrementing the page parameter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesThe user's handle
pageNoPage number for pagination

Implementation Reference

  • The primary MCP tool handler for 'get_user_topics'. Decorated with @mcp.tool(), defines input schema using Pydantic Annotated Fields (username and optional page), includes comprehensive docstring, and delegates to the client implementation.
    @mcp.tool()
    def get_user_topics(
        username: Annotated[
            str,
            Field(description="The user's handle"),
        ],
        page: Annotated[
            int | None,
            Field(default=None, description="Page number for pagination"),
        ] = None,
    ) -> list[dict[str, Any]]:
        """
        Fetch topics created by a specific user.
    
        Args:
            username: The user's handle
            page: Page number for pagination (optional)
    
        Returns a list of topic objects with:
        - id: Topic ID
        - title: Topic title
        - posts_count: Number of replies
        - views: View count
        - created_at: When created
        - category_id: Forum category
    
        Use this to:
        - See what discussions a user has initiated
        - Find expert users in specific areas
        - Research a user's areas of interest
    
        Paginate by incrementing the page parameter.
        """
        return get_client().get_user_topics(username, page=page)
  • Core helper function in UsersAPI that performs the actual HTTP request to fetch user-created topics from '/topics/created-by/{username}.json', handles pagination, and returns raw topic data. Called by the client layer.
    def get_user_topics(
        self,
        username: str,
        page: int | None = None,
    ) -> list[dict[str, Any]]:
        """Fetch topics created by user.
    
        Args:
            username: User handle
            page: Optional page number
    
        Returns:
            List of topic objects (raw API format)
        """
        params_list: list[tuple[str, Any]] = []
        if page is not None:
            params_list.append(("page", int(page)))
    
        payload = self._get(
            f"/topics/created-by/{username}.json",
            params=params_list,
        )
        return payload.get("topic_list", {}).get("topics", [])
  • Client wrapper for get_user_topics that delegates to UsersAPI and enriches topics with category names using _enrich_with_categories. This is the function directly called by the MCP tool handler.
    def get_user_topics(
        self,
        username: str,
        page: int | None = None,
    ) -> list[dict[str, Any]]:
        """Fetch topics created by user.
    
        Args:
            username: User handle
            page: Optional page number
    
        Returns:
            List of topic objects
        """
        topics = self._users.get_user_topics(username, page=page)
        return self._enrich_with_categories(topics)
  • Imports and exports the get_user_topics tool in the main server entrypoint, ensuring it is registered via @mcp.tool() decorator when the module is imported.
    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,
    )
    
    __all__ = [
        "MCP_HOST",
        "MCP_PORT",
        "MCP_TRANSPORT",
        "NITAN_TOKEN",
        "SERVER_INSTRUCTIONS",
        "get_client",
        "main",
        "mcp",
        "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",
        "resource_categories",
        "resource_hot_topics",
        "resource_new_topics",
        "search_forum",
        "subscribe_topic",
        "research_topic",
    ]

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