Skip to main content
Glama
raidenrock

USCardForum MCP Server

by raidenrock

get_user_reactions

Retrieve a user's post reactions to identify their interests and values within the USCardForum community.

Instructions

Fetch a user's post reactions (likes, etc.).

Args:
    username: The user's handle
    offset: Pagination offset (optional)

Returns a UserReactions object with reaction data.

Use to see what content a user has reacted to,
which can indicate their interests and values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesThe user's handle
offsetNoPagination offset

Implementation Reference

  • MCP tool handler for 'get_user_reactions' decorated with @mcp.tool(). Defines input parameters with descriptions and output type UserReactions. Delegates execution to the DiscourseClient.
    @mcp.tool()
    def get_user_reactions(
        username: Annotated[
            str,
            Field(description="The user's handle"),
        ],
        offset: Annotated[
            int | None,
            Field(default=None, description="Pagination offset"),
        ] = None,
    ) -> UserReactions:
        """
        Fetch a user's post reactions (likes, etc.).
    
        Args:
            username: The user's handle
            offset: Pagination offset (optional)
    
        Returns a UserReactions object with reaction data.
    
        Use to see what content a user has reacted to,
        which can indicate their interests and values.
        """
        return get_client().get_user_reactions(username, offset=offset)
  • Pydantic BaseModel defining the output schema for get_user_reactions tool, containing a list of reactions.
    class UserReactions(BaseModel):
        """User's post reactions."""
    
        reactions: list[Any] = Field(default_factory=list, description="Reaction data")
    
        class Config:
            extra = "ignore"
  • Client wrapper method that forwards get_user_reactions call to the UsersAPI instance.
    def get_user_reactions(
        self,
        username: str,
        offset: int | None = None,
    ) -> UserReactions:
        """Fetch user's post reactions.
    
        Args:
            username: User handle
            offset: Optional pagination offset
    
        Returns:
            User reactions data
        """
        return self._users.get_user_reactions(username, offset=offset)
  • Low-level API implementation that performs HTTP GET to fetch user reactions from the Discourse plugin endpoint and parses into UserReactions model.
    def get_user_reactions(
        self,
        username: str,
        offset: int | None = None,
    ) -> UserReactions:
        """Fetch user's post reactions.
    
        Args:
            username: User handle
            offset: Optional pagination offset
    
        Returns:
            User reactions data
        """
        params_list: list[tuple[str, Any]] = [("username", username)]
        if offset is not None:
            params_list.append(("offset", int(offset)))
    
        payload = self._get(
            "/discourse-reactions/posts/reactions.json",
            params=params_list,
        )
        return UserReactions(reactions=payload.get("reactions", []))
  • Tool function re-exported in server_tools package __all__ for import in server.py and MCP registration.
    "get_user_reactions",

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/raidenrock/uscardforum-mcp'

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