get_user_summary
Fetch a user's 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
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | The user's handle (case-insensitive) |
Implementation Reference
- Primary MCP tool handler for 'get_user_summary'. Defines input schema with Pydantic Annotated Field, comprehensive docstring, and delegates execution to DiscourseClient.get_user_summary().@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)
- Pydantic BaseModel defining the output type UserSummary returned by the get_user_summary tool, including fields for user profile, stats, badges, and top content.class UserSummary(BaseModel): """Comprehensive user profile summary.""" user_id: int | None = Field(None, description="User ID") username: str | None = Field(None, description="Username") name: str | None = Field(None, description="Display name") created_at: datetime | None = Field(None, description="Account creation date") last_seen_at: datetime | None = Field(None, description="Last seen online") stats: UserStats | None = Field(None, description="User statistics") badges: list[Badge] = Field(default_factory=list, description="Recent badges") top_topics: list[Any] = Field(default_factory=list, description="Top topics") top_replies: list[Any] = Field(default_factory=list, description="Top replies") class Config: extra = "ignore"
- src/uscardforum/client.py:310-322 (helper)Underlying client method called by the tool handler. Fetches raw user summary from UsersAPI 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
- src/uscardforum/server.py:15-45 (registration)Server entrypoint imports the get_user_summary tool (line 35), along with all other tools. Importing triggers @mcp.tool() decorators to register the tool with the FastMCP server.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, )