Grok Search MCP Server provides two distinct analysis modes that determine the depth and structure of search results. The analysis_mode parameter controls whether you receive simple search results or comprehensive analytical insights.
Basic mode returns straightforward search results with minimal processing overhead. This mode is optimized for speed and simple queries where you need quick, factual information.
const basePrompt = `Provide current, accurate information about the following topic using live search data. Format your response as JSON with this exact structure:{"results": [{ "title": "Article title or tweet content preview", "snippet": "Brief summary", "url": "Source URL", "source": "Source name", "published_date": "YYYY-MM-DD", "author": "Author name"}],"summary": "Brief overview of findings"}`;
Comprehensive mode provides deep, structured analysis with timelines, quotes, multiple perspectives, and detailed context. This mode is designed for research, investigation, and understanding complex topics.
The comprehensive mode uses detailed analytical prompts:
const comprehensivePrompt = `You are a comprehensive research analyst. Provide deep, detailed analysis of the search topic using live search data.CRITICAL INSTRUCTIONS:1. Extract SPECIFIC details: exact dates, numbers, names, locations2. Include DIRECT QUOTES with full attribution3. Create a TIMELINE of events with precise dates4. Analyze MULTIPLE PERSPECTIVES from different stakeholders5. Provide HISTORICAL CONTEXT and background6. Identify IMPLICATIONS and consequences7. Verify information status and note contradictions8. Be comprehensive but accurate - do not invent information`;
Comprehensive analyses are automatically cached for 30 minutes to improve performance on repeat queries. Cache keys include all parameters to ensure accuracy.