Skip to main content
Glama
hmumixaM

USCardForum MCP Server

by hmumixaM

get_user_summary

Fetch a comprehensive user profile summary to evaluate credibility, find valuable contributions, and understand participation level in the USCardForum community.

Instructions

Fetch a comprehensive summary of a user's profile.

Args:
    username: The user's handle (case-insensitive)

Returns a UserSummary object with:
- user_id: User ID
- username: Username
- stats: UserStats with posts, topics, likes given/received, etc.
- badges: List of recent Badge objects
- top_topics: Most successful topics
- top_replies: Most successful replies

Use this to:
- Evaluate a user's credibility and experience
- Find their most valuable contributions
- Understand their participation level

The summary provides a quick overview without fetching
individual post histories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesThe user's handle (case-insensitive)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoDisplay name
statsNoUser statistics
badgesNoRecent badges
user_idNoUser ID
usernameNoUsername
created_atNoAccount creation date
top_topicsNoTop topics
top_repliesNoTop replies
last_seen_atNoLast seen online

Implementation Reference

  • The primary MCP tool handler for 'get_user_summary'. Decorated with @mcp.tool(), it delegates to the DiscourseClient's get_user_summary method.
    @mcp.tool()
    def get_user_summary(
        username: Annotated[
            str,
            Field(description="The user's handle (case-insensitive)"),
        ],
    ) -> UserSummary:
        """
        Fetch a comprehensive summary of a user's profile.
    
        Args:
            username: The user's handle (case-insensitive)
    
        Returns a UserSummary object with:
        - user_id: User ID
        - username: Username
        - stats: UserStats with posts, topics, likes given/received, etc.
        - badges: List of recent Badge objects
        - top_topics: Most successful topics
        - top_replies: Most successful replies
    
        Use this to:
        - Evaluate a user's credibility and experience
        - Find their most valuable contributions
        - Understand their participation level
    
        The summary provides a quick overview without fetching
        individual post histories.
        """
        return get_client().get_user_summary(username)
  • Core API implementation in UsersAPI that fetches user summary data from the Discourse API endpoint /u/{username}/summary.json and parses it into a UserSummary object.
    def get_user_summary(self, username: str) -> UserSummary:
        """Fetch user profile summary.
    
        Args:
            username: User handle
    
        Returns:
            Comprehensive user summary
        """
        payload = self._get(f"/u/{username}/summary.json")
    
        # Extract user stats from various locations
        user_summary = payload.get("user_summary", {})
        user = payload.get("users", [{}])[0] if payload.get("users") else {}
    
        stats = UserStats(
            likes_given=user_summary.get("likes_given", 0),
            likes_received=user_summary.get("likes_received", 0),
            days_visited=user_summary.get("days_visited", 0),
            post_count=user_summary.get("post_count", 0),
            topic_count=user_summary.get("topic_count", 0),
            posts_read_count=user_summary.get("posts_read_count", 0),
            topics_entered=user_summary.get("topics_entered", 0),
        )
    
        badges = []
        for b in user_summary.get("badges", []):
            badges.append(Badge(
                id=b.get("id", 0),
                badge_id=b.get("badge_id", b.get("id", 0)),
                name=b.get("name", ""),
                description=b.get("description"),
                granted_at=b.get("granted_at"),
            ))
    
        return UserSummary(
            user_id=user.get("id"),
            username=user.get("username", username),
            name=user.get("name"),
            created_at=user.get("created_at"),
            last_seen_at=user.get("last_seen_at"),
            stats=stats,
            badges=badges,
            top_topics=user_summary.get("top_topics", []),
            top_replies=user_summary.get("top_replies", []),
        )
  • Wrapper method in DiscourseClient that calls UsersAPI.get_user_summary and enriches top_topics with category names.
    def get_user_summary(self, username: str) -> UserSummary:
        """Fetch user profile summary.
    
        Args:
            username: User handle
    
        Returns:
            Comprehensive user summary
        """
        summary = self._users.get_user_summary(username)
        if summary.top_topics:
            self._enrich_with_categories(summary.top_topics)
        return summary
  • Import of get_user_summary from server_tools, which triggers registration via @mcp.tool() decorator when the server runs.
    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 get_client() that provides the global DiscourseClient instance used by all tools, including 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
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses that the tool returns a comprehensive summary object with specific fields, but doesn't mention behavioral aspects like rate limits, authentication requirements, error conditions, or whether this is a cached/real-time view.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear sections (Args, Returns, Use cases) and front-loaded purpose. Some sentences could be more concise (e.g., 'The summary provides a quick overview without fetching individual post histories' could be tightened), but overall efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/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 (Returns section details the structure) and 100% schema coverage for the single parameter, the description provides adequate context. It explains the tool's purpose, usage scenarios, and what information it provides, though could benefit from mentioning any limitations or prerequisites.

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 the parameter's case-insensitive nature and providing context about what 'username' represents ('user's handle'), elevating it above the minimum viable level.

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 specific action ('Fetch a comprehensive summary') and resource ('user's profile'), distinguishing it from sibling tools like get_user_badges or get_user_topics by emphasizing it provides a holistic overview rather than specific components.

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?

Explicitly states when to use this tool ('Evaluate a user's credibility and experience', 'Find their most valuable contributions', 'Understand their participation level') and when not to use it ('without fetching individual post histories'), providing clear alternatives to more granular 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/hmumixaM/uscardforum-mcp4'

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