Skip to main content
Glama
hmumixaM

USCardForum MCP Server

by hmumixaM

get_user_following

Retrieve a user's following list to discover community influencers, find related experts, and map social connections within USCardForum's credit card discussion platform.

Instructions

Fetch the list of users that a user follows.

Args:
    username: The user's handle
    page: Page number for pagination (optional)

Returns a FollowList object with:
- users: List of FollowUser objects
- total_count: Total users being followed

Use to:
- Discover influential users in the community
- Find related experts
- Map social connections

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYesThe user's handle
pageNoPage number for pagination

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
usersNoUser list
total_countNoTotal users

Implementation Reference

  • The MCP tool handler for 'get_user_following'. Decorated with @mcp.tool(), defines input parameters with descriptions and return type FollowList. Implements the tool logic by calling the DiscourseClient's get_user_following method.
    @mcp.tool()
    def get_user_following(
        username: Annotated[
            str,
            Field(description="The user's handle"),
        ],
        page: Annotated[
            int | None,
            Field(default=None, description="Page number for pagination"),
        ] = None,
    ) -> FollowList:
        """
        Fetch the list of users that a user follows.
    
        Args:
            username: The user's handle
            page: Page number for pagination (optional)
    
        Returns a FollowList object with:
        - users: List of FollowUser objects
        - total_count: Total users being followed
    
        Use to:
        - Discover influential users in the community
        - Find related experts
        - Map social connections
        """
        return get_client().get_user_following(username, page=page)
  • Registration/exposure of the get_user_following tool from server_tools.users module, making it importable by the main 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,
  • Imports all MCP tools including get_user_following (line 32) from server_tools, which triggers auto-registration via @mcp.tool() decorators in the main MCP server entrypoint.
    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,
    )
  • Underlying API implementation in UsersAPI that performs the HTTP GET to the Discourse /u/{username}/follow/following.json endpoint, parses the response, and constructs the FollowList model.
    def get_user_following(
        self,
        username: str,
        page: int | None = None,
    ) -> FollowList:
        """Fetch users that a user follows.
    
        Args:
            username: User handle
            page: Optional page number
    
        Returns:
            List of followed users
        """
        params_list: list[tuple[str, Any]] = []
        if page is not None:
            params_list.append(("page", int(page)))
    
        payload = self._get(
            f"/u/{username}/follow/following.json",
            params=params_list,
        )
    
        users = []
        for u in payload.get("users", []):
            users.append(FollowUser(
                id=u.get("id", 0),
                username=u.get("username", ""),
                name=u.get("name"),
                avatar_template=u.get("avatar_template"),
            ))
    
        return FollowList(
            users=users,
            total_count=payload.get("total_count", len(users)),
        )
  • DiscourseClient wrapper method that delegates to the internal UsersAPI.get_user_following, providing a unified client interface used by the MCP tool handler.
    def get_user_following(
        self,
        username: str,
        page: int | None = None,
    ) -> FollowList:
        """Fetch users that a user follows.
    
        Args:
            username: User handle
            page: Optional page number
    
        Returns:
            List of followed users
        """
        return self._users.get_user_following(username, page=page)
Behavior3/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It reveals pagination behavior through the 'page' parameter documentation and describes the return format (FollowList object structure). However, it doesn't mention rate limits, authentication requirements, error conditions, or whether this is a read-only operation (though 'fetch' implies reading).

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 well-structured with clear sections (purpose, args, returns, use cases). It's appropriately sized at 6 sentences, though the 'Args:' section somewhat duplicates schema information. Most sentences earn their place by providing distinct information.

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 has an output schema (implied by 'Returns a FollowList object'), the description doesn't need to fully explain return values. It provides adequate context for this read-only data retrieval tool, though it could benefit from mentioning authentication requirements or rate limits given no annotations are provided.

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%, so the schema already fully documents both parameters. The description repeats the parameter information in the 'Args:' section but doesn't add meaningful semantic context beyond what's in the schema (e.g., format expectations for username, pagination strategy details). Baseline 3 is appropriate when schema does the heavy lifting.

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 with 'Fetch the list of users that a user follows' - a specific verb+resource combination. It distinguishes itself from sibling tools like get_user_followers (which would fetch followers rather than following), though it doesn't explicitly mention this distinction in the description itself.

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

Usage Guidelines4/5

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

The 'Use to:' section provides clear context about when to use this tool ('Discover influential users', 'Find related experts', 'Map social connections'). However, it doesn't explicitly state when NOT to use it or mention specific alternatives among the sibling tools (like get_user_followers for the reverse relationship).

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