get_user_profile
Retrieve comprehensive profile details for a user on X (Twitter) by providing their user ID, enabling analysis or integration with other systems.
Instructions
Get detailed profile information for a user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | Yes |
Implementation Reference
- src/x_twitter_mcp/server.py:94-103 (handler)The handler function for the 'get_user_profile' tool, decorated with @server.tool for registration. It initializes the Twitter v2 client and fetches the user profile using client.get_user with specified fields, returning the user data.@server.tool(name="get_user_profile", description="Get detailed profile information for a user") async def get_user_profile(user_id: str) -> Dict: """Fetches user profile by user ID. Args: user_id (str): The ID of the user to look up. """ client, _ = initialize_twitter_clients() user = client.get_user(id=user_id, user_fields=["id", "name", "username", "profile_image_url", "description"]) return user.data
- src/x_twitter_mcp/server.py:94-94 (registration)Registers the tool named 'get_user_profile' with description using the FastMCP @server.tool decorator.@server.tool(name="get_user_profile", description="Get detailed profile information for a user")