x_search
Search X posts, profiles, and threads to get cited answers on current discussions, reactions, and account context. Filter by date or handles and set search depth to keep queries precise.
Instructions
Search X posts, profiles, and threads with xAI's server-side X Search (Grok reads the posts and answers with citations). Handles Chinese queries well. Use for current X discussion, reactions, and account or thread context. Billing is per post fetched, so precise queries give better results for the same cost. If a call times out or returns no citations: do not resend the same query. Narrow it (date range, specific accounts, fewer topics per query), split it into sub-questions, then cross-check with another source (Exa, web search, or the X website in a logged-in browser). If the error says credits ran out, stop calling this tool and use those other sources.
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": {
"query": "<query>"
},
"name": "x_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | standard: grok-4.7, one agent, for looking up facts and normal research. deep: grok-4.20-multi-agent with 4 agents searching and cross-checking in parallel. Start every important decision here (money, career, strategy). deep_max: 16 agents. Choose it by the shape of the question, not by its importance: escalate when the question splits into 4 or more independent sub-questions, when a deep run returns conflicting claims or too few citations to support a conclusion, or when the user asks for maximum depth. More agents add little to a narrow question. Cost grows with agents because every agent fetches posts. | standard |
| query | Yes | What to look up on X. | |
| to_date | No | Optional end date, YYYY-MM-DD, exclusive. | |
| from_date | No | Optional start date, YYYY-MM-DD. | |
| reasoning_effort | No | Only for depth=standard. low for a quick fact, high (default) for normal research, xhigh for hard synthesis. | high |
| allowed_x_handles | No | Only search posts from these accounts, without @ (max 20). Cannot be combined with excluded_x_handles. | |
| excluded_x_handles | No | Ignore posts from these accounts, without @ (max 20). | |
| enable_image_understanding | No | Whether xAI should analyze images attached to matching X posts. | |
| enable_video_understanding | No | Whether xAI should analyze videos attached to matching X posts. |