Skip to main content
Glama
rafaljanicki

X (Twitter) MCP server

by rafaljanicki

get_user_followers_you_know

Identify common followers between users on X (Twitter) by providing a user ID. Retrieve a simulated list of shared connections to analyze mutual relationships.

Instructions

Retrieves a list of common followers (simulated)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countNo
cursorNo
user_idYes

Implementation Reference

  • The handler function for the 'get_user_followers_you_know' tool, decorated with @server.tool for registration. It simulates retrieving common followers by fetching the user's followers using Tweepy v2 API, with rate limiting and pagination support.
    @server.tool(name="get_user_followers_you_know", description="Retrieves a list of common followers (simulated)") async def get_user_followers_you_know(user_id: str, count: Optional[int] = 100, cursor: Optional[str] = None) -> List[Dict]: """Retrieves a list of common followers. (Simulated as Twitter API v2 doesn't directly support this). Args: user_id (str): The user ID to check for common followers. count (Optional[int]): The number of followers to retrieve and check. Default is 100. cursor (Optional[str]): A pagination token for fetching the user's followers. """ if not check_rate_limit("follow_actions"): raise Exception("Follow action rate limit exceeded") client, _ = initialize_twitter_clients() # Simulate by fetching followers and filtering (v2 doesn't directly support mutual followers) followers = client.get_users_followers(id=user_id, max_results=count, pagination_token=cursor, user_fields=["id", "name", "username"]) return [user.data for user in followers.data][:count]
  • The @server.tool decorator registers the 'get_user_followers_you_know' tool with FastMCP server.
    @server.tool(name="get_user_followers_you_know", description="Retrieves a list of common followers (simulated)")

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