Overview
Thegrok_search tool is the primary universal search interface that provides AI-powered search capabilities across multiple content types. It supports both basic search results and comprehensive analysis with timelines, quotes, and multiple perspectives.
Parameters
The search query to execute. Must be a non-empty string with a maximum length of 1000 characters.
Type of search to perform. Must be one of:
web- Search general web content including articles, blogs, and informational pagesnews- Focus on recent news articles and current eventsgeneral- Comprehensive search across all sources including web, news, and social media
webAnalysis depth and format. Must be one of:
basic- Returns simple search results with titles, snippets, and URLscomprehensive- Provides detailed analysis with timelines, quotes, multiple perspectives, and context (500+ word analysis)
basicNote: Comprehensive analyses are cached for 30 minutes and use approximately 4000 tokens vs 2000 for basic mode.Maximum number of search results to return.Constraints:
- Minimum: 1
- Maximum: 20
- Default: 10
Optional start date for search in ISO8601 format (YYYY-MM-DD). Limits search to content from this date onwards.Validation:
- Must match pattern:
^\d{4}-\d{2}-\d{2}$ - Must be a valid calendar date
- Must be before or equal to
to_dateif both are provided
2025-01-01Optional end date for search in ISO8601 format (YYYY-MM-DD). Limits search to content up to this date.Validation:
- Must match pattern:
^\d{4}-\d{2}-\d{2}$ - Must be a valid calendar date
- Must be after or equal to
from_dateif both are provided
2025-12-31Request Examples
Response Format
Basic Mode Response
Comprehensive Mode Response
Error Response
Common Error Messages
Search query must be a non-empty string- Query parameter is missing or emptySearch query too long (max 1000 characters)- Query exceeds maximum lengthfrom_date must be in ISO8601 format (YYYY-MM-DD)- Invalid date formatfrom_date must be before or equal to to_date- Invalid date rangeAPI service is not healthy - missing XAI_API_KEY- API key not configuredRequest timeout after 30000ms- Request exceeded timeout limit
Usage Notes
- Performance: Basic mode responds faster and uses fewer tokens than comprehensive mode
- Caching: Comprehensive analyses are automatically cached for 30 minutes
- Retries: The server automatically retries failed requests up to 3 times with exponential backoff
- Token Usage: Basic mode uses ~2000 tokens, comprehensive mode uses ~4000 tokens
- Date Filtering: Date ranges apply to content publication dates, not query time
- Citation Metadata: Enhanced citation processing includes domain validation and security status