Skip to main content
Glama
hmumixaM

USCardForum MCP Server

by hmumixaM

get_user_reactions

Fetch a user's post reactions (likes) to identify their interests and values on USCardForum's credit card discussions.

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
reactionsNoReaction data

Implementation Reference

  • The MCP tool handler for 'get_user_reactions', decorated with @mcp.tool(). Defines input schema via Annotated Fields 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)
  • Imports get_user_reactions (line 33) along with all other MCP tools into the server entrypoint, making them available for FastMCP registration.
    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,
    )
  • Re-exports get_user_reactions from the users module (line 45), aggregating all user-related tools for easy import in server.py.
    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,
    )
  • DiscourseClient wrapper method that delegates get_user_reactions 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 UsersAPI implementation that performs the HTTP GET request to the Discourse endpoint for user reactions and parses the 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", []))
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that the tool fetches data (implying read-only behavior) and mentions pagination via the 'offset' parameter, which adds useful context. However, it doesn't cover other behavioral aspects like rate limits, authentication needs, error conditions, or what 'UserReactions object' contains beyond 'reaction data'. The description adds some value but leaves gaps.

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?

The description is appropriately sized and front-loaded: the first sentence states the purpose clearly, followed by parameter and return value notes, then usage guidance. Each sentence adds value (e.g., explaining the purpose of fetching reactions). It could be slightly more structured (e.g., separating sections), but it's efficient with zero waste.

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's moderate complexity (2 parameters, read-only operation), the description is reasonably complete. It covers purpose, parameters, returns, and usage context. Since an output schema exists (implied by 'Returns a UserReactions object'), the description doesn't need to detail return values. However, with no annotations, it could better address behavioral aspects like error handling or data scope.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters ('username' and 'offset') well-documented in the schema. The description adds minimal semantics: it restates 'username' as 'The user's handle' and 'offset' as 'Pagination offset', which doesn't provide additional meaning beyond the schema. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Fetch a user's post reactions (likes, etc.)'. It specifies the verb (fetch) and resource (user's post reactions), making the function unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_user_actions' or 'get_user_replies', which might also involve user activity data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage context: 'Use to see what content a user has reacted to, which can indicate their interests and values.' This implies when to use the tool (for analyzing user interests via reactions), but it doesn't explicitly state when not to use it or name alternatives among siblings (e.g., 'get_user_actions' for broader activity). The guidance is helpful but not comprehensive.

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