X Search
x_searchSearch X posts using xAI's Responses API to find relevant content with filtering options and structured results.
Instructions
Search X posts using xAI's Responses API x_search tool. Returns a normalized answer and citations.
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 |
|---|---|---|---|
| query | Yes | Search query for X | |
| allowed_x_handles | No | Only include posts from these handles | |
| excluded_x_handles | No | Exclude posts from these handles | |
| from_date | No | Start date (YYYY-MM-DD) | |
| to_date | No | End date (YYYY-MM-DD) | |
| enable_image_understanding | No | Enable image understanding | |
| enable_video_understanding | No | Enable video understanding | |
| include_raw_response | No | Include raw xAI response for debugging |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| answer | Yes | ||
| citations | Yes | ||
| raw_response | No | ||
| inline_citations | Yes |