Skip to main content
Glama
rafaljanicki

X (Twitter) MCP server

by rafaljanicki

get_user_subscriptions

Retrieve a list of users a specific account is following on X (Twitter) by providing the user ID, count, and cursor for pagination.

Instructions

Retrieves a list of users to which the specified user is subscribed (uses following as proxy)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo
cursorNo
user_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_user_subscriptions' tool. It checks rate limits, initializes the Twitter client, fetches the user's following list (used as proxy for subscriptions), and returns the list of user dicts.
    async def get_user_subscriptions(user_id: str, count: Optional[int] = 100, cursor: Optional[str] = None) -> List[Dict]:
        """Retrieves a list of subscribed users. (Uses 'following' as a proxy as Twitter API v2 doesn't have a direct 'subscriptions' endpoint).
    
        Args:
            user_id (str): The user ID whose subscriptions (following list) are to be retrieved.
            count (Optional[int]): The number of users to retrieve per page. Default is 100.
            cursor (Optional[str]): A pagination token for fetching the next set of results.
        """
        if not check_rate_limit("follow_actions"):
            raise Exception("Follow action rate limit exceeded")
        client, _ = initialize_twitter_clients()
        # Use following as proxy for subscriptions
        subscriptions = client.get_users_following(id=user_id, max_results=count, pagination_token=cursor, user_fields=["id", "name", "username"])
        return [user.data for user in subscriptions.data]
  • Registers the 'get_user_subscriptions' tool with FastMCP server using the @server.tool decorator, specifying the name and description.
    @server.tool(name="get_user_subscriptions", description="Retrieves a list of users to which the specified user is subscribed (uses following as proxy)")
  • Input schema defined by function parameters: user_id (str), count (Optional[int]=100), cursor (Optional[str]=None). Output: List[Dict].
    async def get_user_subscriptions(user_id: str, count: Optional[int] = 100, cursor: Optional[str] = None) -> List[Dict]:
Behavior2/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 of behavioral disclosure. It states this is a retrieval operation, implying it's read-only, but doesn't mention pagination behavior (though parameters suggest it), rate limits, authentication requirements, or what the output looks like. The phrase 'uses following as proxy' adds some context but is vague about implementation details.

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 a single, efficient sentence that gets straight to the point. It's appropriately sized for a retrieval tool, with no wasted words. However, the phrase 'uses following as proxy' is somewhat cryptic and could be clarified without adding excessive length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/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 (which should document return values), the description doesn't need to explain outputs. However, for a tool with 3 parameters (0% schema coverage) and no annotations, it should provide more context about pagination behavior and the meaning of 'subscribed'. The current description is minimally adequate but leaves gaps in understanding how to use the tool effectively.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It only mentions 'specified user' which maps to user_id, but doesn't explain count (default 100, pagination limit) or cursor (pagination token). With 3 parameters and no schema descriptions, the description adds minimal value beyond what's inferred from parameter names.

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: 'Retrieves a list of users to which the specified user is subscribed'. It specifies the verb 'retrieves' and the resource 'list of users', and distinguishes it from siblings like get_user_followers or get_user_following by focusing on subscriptions. However, it doesn't fully explain what 'subscribed' means in this context, leaving some ambiguity.

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. It mentions 'uses following as proxy', which hints at a relationship to 'following' functionality, but doesn't explicitly state when to choose this over get_user_following or other user-related tools. No exclusions or prerequisites are mentioned.

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

Related 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/rafaljanicki/x-twitter-mcp-server'

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