get_user_reactions
Fetch a user's post reactions (likes, etc.) to see what content they engage with, indicating their interests and values on 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
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | The user's handle | |
| offset | No | Pagination offset |
Implementation Reference
- The primary MCP tool handler for 'get_user_reactions'. Decorated with @mcp.tool(), defines input schema (username: Annotated[str], offset: Annotated[int|None]) and output type UserReactions. Delegates execution to get_client().get_user_reactions().@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)
- src/uscardforum/server.py:15-45 (registration)Registration via import into MCP server entrypoint (server.py). The import from server_tools registers all @mcp.tool() functions, including get_user_reactions (line 33).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, )
- src/uscardforum/server_tools/__init__.py:37-47 (registration)Package-level re-export: imports get_user_reactions from .users (line 45) and includes in __all__ (line 86), facilitating registration.from .users import ( get_user_summary, get_user_topics, get_user_replies, get_user_actions, get_user_badges, get_user_following, get_user_followers, get_user_reactions, list_users_with_badge, )
- src/uscardforum/api/users.py:285-308 (helper)Underlying HTTP API implementation in UsersAPI.get_user_reactions(). Performs GET request to '/discourse-reactions/posts/reactions.json', parses response 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", []))
- src/uscardforum/client.py:440-454 (helper)Client-side wrapper in DiscourseClient.get_user_reactions(), which delegates to the UsersAPI instance (_users.get_user_reactions()). Called by the MCP handler.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)