Skip to main content
Glama
rhettlong

USCardForum MCP Server

by rhettlong

get_user_followers

Fetch the list of users following a specific USCardForum member to identify influential community contributors and analyze follower relationships.

Instructions

Fetch the list of users following a specific user.

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 followers

A high follower count often indicates an influential
or helpful community member.

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 primary MCP tool handler for 'get_user_followers'. Decorated with @mcp.tool(), defines input schema using Pydantic Annotated and Field, includes comprehensive docstring, and implements logic by delegating to the DiscourseClient instance.
    @mcp.tool()
    def get_user_followers(
        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 following a specific user.
    
        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 followers
    
        A high follower count often indicates an influential
        or helpful community member.
        """
        return get_client().get_user_followers(username, page=page)
  • Input/output schema defined via function signature: username (str, required), page (int|None, optional), returns FollowList. Uses Pydantic Field for descriptions and validation.
    @mcp.tool()
    def get_user_followers(
        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 following a specific user.
    
        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 followers
    
        A high follower count often indicates an influential
        or helpful community member.
        """
        return get_client().get_user_followers(username, page=page)
  • Core API helper implementation in UsersAPI that performs the HTTP GET request to the Discourse /u/{username}/follow/followers.json endpoint, parses the JSON response, constructs FollowUser objects, and returns FollowList.
    def get_user_followers(
        self,
        username: str,
        page: int | None = None,
    ) -> FollowList:
        """Fetch users following a user.
    
        Args:
            username: User handle
            page: Optional page number
    
        Returns:
            List of follower 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/followers.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)),
        )
  • Import statement in server_tools/__init__.py that exposes get_user_followers from users.py, making it available for import and MCP 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,
    )
  • Main server.py imports all server_tools functions including get_user_followers to ensure they are loaded and registered as MCP tools when the server starts.
    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,
    )
Behavior2/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 mentions pagination and the return structure, but doesn't cover important aspects like rate limits, authentication requirements, error conditions, or whether this is a read-only operation. The description adds some context about follower count significance, but this is more commentary than behavioral transparency.

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 for purpose, arguments, and returns. The final sentence about follower count significance, while potentially helpful for context, doesn't directly aid tool invocation and could be considered extraneous. Overall, it's appropriately sized and front-loaded with the core functionality.

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 that there's an output schema (implied by the return description), the description doesn't need to fully explain return values. It covers the basic purpose and parameters adequately. However, for a tool with no annotations and multiple sibling tools in the same domain, more contextual guidance about when to use this specific tool would improve completeness.

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 without adding meaningful semantic context beyond what's in the schema. It doesn't explain format requirements for 'username' or how pagination works in practice.

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 a specific verb ('Fetch') and resource ('list of users following a specific user'), making it immediately understandable. However, it doesn't explicitly differentiate from its sibling 'get_user_following', which likely retrieves users that a specific user is following rather than followers of that user.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'get_user_following' or 'get_user_summary'. It mentions pagination but doesn't explain when pagination is needed or how to handle large result sets. No prerequisites or exclusions are stated.

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

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