Get user by username
get_user_by_usernameRetrieve an X (Twitter) user profile by handle to obtain name, bio, follower/following counts, verification, creation date, and the numeric rest_id other tools need.
Instructions
Get an X (Twitter) user's profile by handle: name, bio, follower/following counts, verification, created date, and the numeric user ID (rest_id) needed by other tools.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"username": "<username>"
},
"name": "get_user_by_username"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Response format (default simple). simple: compact JSON with flat camelCase tweets and users, about 60% fewer tokens. raw: X's full GraphQL JSON, only needed for fields simple leaves out (cards, polls, edit history, community notes). | |
| username | Yes | X handle without the URL, e.g. "elonmusk" (a leading @ is fine). | |
| max_chars | No | Maximum characters of JSON to return (default 50000). Longer output is cut with a [TRUNCATED] marker. Lower it to save context, raise it if you need the full response. |