Skip to main content
Glama
hmumixaM

USCardForum MCP Server

by hmumixaM

get_user_summary

Fetch a user's profile summary to evaluate credibility, find valuable contributions, and understand participation level on USCardForum.

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)

Implementation Reference

  • The primary MCP tool handler for 'get_user_summary', registered via @mcp.tool() decorator. It defines the input schema using Annotated[str, Field] and delegates execution to the DiscourseClient.
    @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 get_user_summary, including user 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"
  • Supporting API method in UsersAPI that performs the HTTP GET to /u/{username}/summary.json, parses the JSON response, constructs UserStats and Badge objects, and returns the UserSummary.
    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", []), )
  • Client wrapper method that delegates to 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 in the server entrypoint, ensuring the tool is loaded when the server runs.
    get_user_summary,

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