Skip to main content
Glama
rafaljanicki

X (Twitter) MCP server

by rafaljanicki

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
NameRequiredDescriptionDefault
user_idYes

Implementation Reference

  • 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
  • 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")

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