X Search
Search X/Twitter posts and content through Grok's native x_search tool
X Search lets a Grok-powered agent search posts and content on X, formerly Twitter, while it responds.
What it does
This tool uses xAI's native x_search capability. It can help an agent find recent posts, discussions, and threads on X without connecting a separate MCP server.
Requirements
X Search is only available when your agent is configured to use an xAI (Grok) model. When your agent uses a different model provider, use GPT Search, Google Search, or xAI Web Search where appropriate.
Adding the tool to an agent
Open an agent in the editor.
Make sure the agent's model is set to an xAI Grok model.
Click the button with the tooltip Add MCP Tool or Sub Agent.
In MCP Tools, click X Search.
Configuration
X Search settings are configured in the MCP tool settings sheet:
allowed_x_handles
Only consider posts from specific X handles (max 20). The default is blank.
excluded_x_handles
Exclude posts from specific X handles (max 20). The default is blank.
included_domains
Prefer or limit linked content to specific domains (max 20). The default is blank.
excluded_domains
Exclude linked content from specific domains (max 20). The default is blank.
from_date
Start date for search range (YYYY-MM-DD). The default is blank.
to_date
End date for search range (YYYY-MM-DD). The default is blank.
enable_image_understanding
Enable analysis of images in posts. The default is disabled.
enable_video_understanding
Enable analysis of videos in posts. The default is disabled.
Notes:
Allowed X HandlesandExcluded X Handlesare mutually exclusive.Dates must be valid ISO date strings (
YYYY-MM-DD).
Use cases
Monitor what people are saying about a company, product, topic, or event on X.
Find recent posts and threads before answering a time-sensitive question.
Gather social context and public reactions from X content.
Billing
X Search is billed at $0.005 per completed request/tool call.
Notes
X Search searches X/Twitter posts and content. For public web results from Grok, use xAI Web Search.
This tool is powered by xAI's native
x_searchcapability, not an external MCP server.Use Chat in the editor to see when the agent calls X Search during a test run. See Testing with Chat.
Last updated