### Installation and Configuration Source: https://context7.com/gudastudio/groksearch/llms.txt Instructions for installing the Grok Search MCP server and configuring necessary environment variables. ```APIDOC ## Installation and Configuration ### One-Click Installation of MCP Server ```bash # Uninstall old version (if any) claude mcp remove grok-search # Install new version, replace environment variables with your own values claude mcp add-json grok-search --scope user '{ "type": "stdio", "command": "uvx", "args": [ "--from", "git+https://github.com/GuDaStudio/GrokSearch@grok-with-tavily", "grok-search" ], "env": { "GROK_API_URL": "https://your-api-endpoint.com/v1", "GROK_API_KEY": "your-grok-api-key", "TAVILY_API_KEY": "tvly-your-tavily-key", "TAVILY_API_URL": "https://api.tavily.com" } }' # Verify installation claude mcp list ``` ### Environment Variable Configuration ```bash # Required Configuration export GROK_API_URL="https://your-api-endpoint.com/v1" # Grok API address (OpenAI compatible format) export GROK_API_KEY="your-grok-api-key" # Grok API key # Optional Configuration - Tavily (for web_fetch / web_map) export TAVILY_API_KEY="tvly-your-tavily-key" export TAVILY_API_URL="https://api.tavily.com" export TAVILY_ENABLED="true" # Optional Configuration - Firecrawl (fallback for Tavily) export FIRECRAWL_API_KEY="your-firecrawl-key" export FIRECRAWL_API_URL="https://api.firecrawl.dev/v2" # Optional Configuration - Model and Debugging export GROK_MODEL="grok-4-fast" # Default model export GROK_DEBUG="false" # Debug mode export GROK_LOG_LEVEL="INFO" # Log level export GROK_LOG_DIR="logs" # Log directory # Optional Configuration - Retry Strategy export GROK_RETRY_MAX_ATTEMPTS="3" # Maximum retry attempts export GROK_RETRY_MULTIPLIER="1" # Retry backoff multiplier export GROK_RETRY_MAX_WAIT="10" # Maximum retry wait seconds ``` ``` -------------------------------- ### Install uv package manager Source: https://github.com/gudastudio/groksearch/blob/main/README.md Commands to install the uv package manager on Linux/macOS or Windows. ```bash # Linux/macOS curl -LsSf https://astral.sh/uv/install.sh | sh # Windows PowerShell powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" ``` -------------------------------- ### Verify MCP installation Source: https://github.com/gudastudio/groksearch/blob/main/README.md Command to list installed MCP servers to verify the installation. ```bash claude mcp list ``` -------------------------------- ### Install Grok Search MCP Server Source: https://context7.com/gudastudio/groksearch/llms.txt Installs the Grok Search MCP server using the 'claude mcp add-json' command. Ensure you replace placeholder environment variables with your actual API keys and endpoints. After installation, verify with 'claude mcp list'. ```bash # Uninstall old version (if any) claude mcp remove grok-search # Install new version, replace environment variables with your own values claude mcp add-json grok-search --scope user '{ "type": "stdio", "command": "uvx", "args": [ "--from", "git+https://github.com/GuDaStudio/GrokSearch@grok-with-tavily", "grok-search" ], "env": { "GROK_API_URL": "https://your-api-endpoint.com/v1", "GROK_API_KEY": "your-grok-api-key", "TAVILY_API_KEY": "tvly-your-tavily-key", "TAVILY_API_URL": "https://api.tavily.com" } }' # Verify installation claude mcp list ``` -------------------------------- ### Add Grok Search MCP with native TLS Source: https://github.com/gudastudio/groksearch/blob/main/README.md Alternative installation command using --native-tls to resolve SSL certificate verification issues. ```bash claude mcp add-json grok-search --scope user '{ "type": "stdio", "command": "uvx", "args": [ "--native-tls", "--from", "git+https://github.com/GuDaStudio/GrokSearch@grok-with-tavily", "grok-search" ], "env": { "GROK_API_URL": "https://your-api-endpoint.com/v1", "GROK_API_KEY": "your-grok-api-key", "TAVILY_API_KEY": "tvly-your-tavily-key", "TAVILY_API_URL": "https://api.tavily.com" } }' ``` -------------------------------- ### Grok Search MCP Configuration Example Source: https://context7.com/gudastudio/groksearch/llms.txt This JSON structure represents the configuration for Grok Search MCP, including completed phases, complexity level, plan completion status, and the executable plan details. ```json { "completed_phases": ["intent_analysis", "complexity_assessment", ...], "complexity_level": 2, "plan_complete": true, "executable_plan": { "intent_analysis": {...}, "complexity_assessment": {...}, "query_decomposition": [...], "search_strategy": {...}, "tool_selection": [...], "execution_order": {...} } } ``` -------------------------------- ### GET get_config_info Source: https://context7.com/gudastudio/groksearch/llms.txt Retrieves the current configuration status, tests the Grok API connection, and lists available models. ```APIDOC ## GET get_config_info ### Description Displays all configuration states, tests Grok API connectivity, and returns response time and available model lists. API keys are automatically masked. ### Method GET ### Endpoint get_config_info ### Response #### Success Response (200) - **GROK_API_URL** (string) - The configured Grok API URL. - **GROK_API_KEY** (string) - Masked API key. - **connection_test** (object) - Status of the connection, response time, and available models. ``` -------------------------------- ### Uninstall old MCP version Source: https://github.com/gudastudio/groksearch/blob/main/README.md Command to remove an existing installation of the grok-search MCP. ```bash claude mcp remove grok-search ``` -------------------------------- ### get_sources - Get Source List Source: https://context7.com/gudastudio/groksearch/llms.txt Retrieves the list of all sources for a given search session ID obtained from `web_search`. Includes URLs, titles, descriptions, and provider information. ```APIDOC ## get_sources - Get Source List Retrieves the list of all sources for a given search session ID obtained from `web_search`. Includes URLs, titles, descriptions, and provider information. ### Parameters #### Request Body - **session_id** (string) - Required - The session ID returned by `web_search`. ### Request Example ```json { "session_id": "a1b2c3d4e5f6" } ``` ### Response Example (Success) ```json { "session_id": "a1b2c3d4e5f6", "sources_count": 5, "sources": [ { "url": "https://fastapi.tiangolo.com/release-notes/", "title": "Release Notes - FastAPI", "provider": "grok" }, { "url": "https://github.com/tiangolo/fastapi/releases", "title": "Releases · tiangolo/fastapi", "description": "FastAPI framework releases and changelogs", "provider": "tavily" } ] } ``` ``` -------------------------------- ### Get Sources API Source: https://github.com/gudastudio/groksearch/blob/main/README.md Retrieves all sources associated with a `web_search` session using the provided `session_id`. ```APIDOC ## POST /get_sources ### Description Retrieves all sources for a given `session_id` obtained from a `web_search` query. ### Method POST ### Endpoint /get_sources ### Parameters #### Request Body - **session_id** (string) - Required - The session ID returned by `web_search`. ### Request Example ```json { "session_id": "sess_abc123" } ``` ### Response #### Success Response (200) - **session_id** (string) - The session ID. - **sources_count** (int) - The total number of sources. - **sources** (array) - A list of sources, each potentially containing `url`, `title`, `description`, and `provider`. #### Response Example ```json { "session_id": "sess_abc123", "sources_count": 5, "sources": [ { "url": "http://example.com/source1", "title": "Source 1 Title", "description": "Description for source 1.", "provider": "ExampleProvider" } ] } ``` ``` -------------------------------- ### web_fetch - Web Content Scraping Source: https://context7.com/gudastudio/groksearch/llms.txt Fetches complete web page content and returns it in Markdown format using the Tavily Extract API. It includes a fallback mechanism to Firecrawl Scrape if Tavily fails and supports automatic retries for empty content. Error handling examples show responses for missing API keys or general scraping failures. ```json # MCP tool call example # Tool name: web_fetch # Parameter description: # url: str (required) - The target web page URL { "url": "https://docs.python.org/3/whatsnew/3.12.html" } ``` ```json # Error handling example (missing API keys) { "url": "https://example.com/protected-page" } ``` ```json # Error handling example (scraping failure) { "url": "https://example.com/protected-page" } ``` -------------------------------- ### 控制工具路由状态 Source: https://context7.com/gudastudio/groksearch/llms.txt 通过 toggle_builtin_tools 工具管理 Claude Code 官方 WebSearch 和 WebFetch 工具的启用状态。 ```json { "action": "status" } ``` ```json { "action": "on" } ``` ```json { "action": "off" } ``` -------------------------------- ### 执行搜索规划流程 Source: https://context7.com/gudastudio/groksearch/llms.txt 通过一系列阶段性工具调用(plan_intent 到 plan_execution)构建结构化的搜索计划。 ```json { "thought": "用户需要了解 RAG 技术的最新进展,这是一个探索性查询", "core_question": "RAG 技术在 2024 年有哪些最新进展和最佳实践?", "query_type": "exploratory", "time_sensitivity": "recent", "domain": "AI/NLP", "ambiguities": "RAG 具体指检索增强生成还是其他含义", "unverified_terms": "RAG" } ``` ```json { "session_id": "abc123def456", "thought": "这个查询需要多个维度的信息,属于中等复杂度", "level": 2, "estimated_sub_queries": 4, "estimated_tool_calls": 6, "justification": "需要搜索技术概述、最新论文、实践案例和工具框架" } ``` ```json { "session_id": "abc123def456", "thought": "首先需要了解 RAG 技术的基础概念和最新发展", "id": "sq1", "goal": "获取 RAG 技术 2024 年的最新论文和研究进展", "expected_output": "近期重要论文列表和关键技术突破", "boundary": "仅限学术研究,不包括商业产品和开源框架", "tool_hint": "web_search" } ``` ```json { "session_id": "abc123def456", "thought": "需要了解实际应用中的最佳实践", "id": "sq2", "goal": "收集 RAG 技术的企业落地案例和最佳实践", "expected_output": "企业案例分析和实施建议", "boundary": "仅限实践案例,不包括学术论文", "depends_on": "sq1", "tool_hint": "web_search" } ``` ```json { "session_id": "abc123def456", "thought": "使用广泛搜索策略,先获取整体概览", "term": "RAG 2024 latest research papers", "purpose": "sq1", "round": 1, "approach": "broad_first", "fallback_plan": "如果英文搜索无果,尝试中文关键词" } ``` ```json { "session_id": "abc123def456", "thought": "针对实践案例的搜索词", "term": "RAG enterprise implementation case study", "purpose": "sq2", "round": 1 } ``` ```json { "session_id": "abc123def456", "thought": "学术搜索适合使用 web_search", "sub_query_id": "sq1", "tool": "web_search", "reason": "需要获取广泛的搜索结果进行筛选" } ``` ```json { "session_id": "abc123def456", "thought": "sq1 和 sq3 可以并行,sq2 依赖 sq1 的结果", "parallel_groups": "sq1,sq3;sq2,sq4", "sequential": "sq1,sq2", "estimated_rounds": 2 } ``` -------------------------------- ### Configure Grok Search MCP Environment Variables Source: https://context7.com/gudastudio/groksearch/llms.txt Sets up essential and optional environment variables for Grok Search MCP. Required variables include Grok API URL and Key. Optional variables configure Tavily, Firecrawl, model, debugging, logging, and retry strategies. ```bash # Required configuration export GROK_API_URL="https://your-api-endpoint.com/v1" # Grok API address (OpenAI compatible format) export GROK_API_KEY="your-grok-api-key" # Grok API key # Optional configuration - Tavily (for web_fetch / web_map) export TAVILY_API_KEY="tvly-your-tavily-key" export TAVILY_API_URL="https://api.tavily.com" export TAVILY_ENABLED="true" # Optional configuration - Firecrawl (fallback for Tavily) export FIRECRAWL_API_KEY="your-firecrawl-key" export FIRECRAWL_API_URL="https://api.firecrawl.dev/v2" # Optional configuration - Model and Debugging export GROK_MODEL="grok-4-fast" # Default model export GROK_DEBUG="false" # Debug mode export GROK_LOG_LEVEL="INFO" # Log level export GROK_LOG_DIR="logs" # Log directory # Optional configuration - Retry strategy export GROK_RETRY_MAX_ATTEMPTS="3" # Maximum retry attempts export GROK_RETRY_MULTIPLIER="1" # Retry backoff multiplier export GROK_RETRY_MAX_WAIT="10" # Maximum retry wait seconds ``` -------------------------------- ### POST Search Planning Tools Source: https://context7.com/gudastudio/groksearch/llms.txt A suite of tools for structured, multi-stage search planning before execution. ```APIDOC ## POST plan_intent / plan_complexity / plan_sub_query / plan_search_term / plan_tool_mapping / plan_execution ### Description Structured multi-stage search planning. The process involves analyzing intent, assessing complexity, decomposing queries, defining search terms, mapping tools, and defining execution order. ### Method POST ### Endpoint plan_intent, plan_complexity, plan_sub_query, plan_search_term, plan_tool_mapping, plan_execution ### Parameters #### Request Body - **session_id** (string) - Required (for subsequent stages) - The unique identifier for the search planning session. - **thought** (string) - Required - Reasoning for the current planning step. ``` -------------------------------- ### 获取配置诊断信息 Source: https://context7.com/gudastudio/groksearch/llms.txt 调用 get_config_info 工具以显示配置状态、测试 API 连接并列出可用模型。 ```json {} ``` -------------------------------- ### POST switch_model Source: https://context7.com/gudastudio/groksearch/llms.txt Switches the default Grok model and persists the configuration to the local config file. ```APIDOC ## POST switch_model ### Description Switches the default Grok model used by the application. Changes are persisted to ~/.config/grok-search/config.json. ### Method POST ### Endpoint switch_model ### Parameters #### Request Body - **model** (string) - Required - The ID of the model to switch to. ### Response #### Success Response (200) - **status** (string) - Success status. - **current_model** (string) - The newly active model ID. ``` -------------------------------- ### 执行带过滤指令的深度映射 Source: https://context7.com/gudastudio/groksearch/llms.txt 通过指定 URL、过滤指令及搜索深度限制来执行深度映射任务。 ```json { "url": "https://fastapi.tiangolo.com/", "instructions": "only documentation pages about authentication", "max_depth": 2, "max_breadth": 30, "limit": 100 } ``` -------------------------------- ### POST toggle_builtin_tools Source: https://context7.com/gudastudio/groksearch/llms.txt Controls the permission settings for built-in Claude Code tools (WebSearch/WebFetch). ```APIDOC ## POST toggle_builtin_tools ### Description Modifies the project-level .claude/settings.json to enable or disable official WebSearch and WebFetch tools. ### Method POST ### Endpoint toggle_builtin_tools ### Parameters #### Request Body - **action** (string) - Optional - 'on' to disable, 'off' to enable, 'status' to check current state. Defaults to 'status'. ``` -------------------------------- ### get_sources - Retrieve Source List Source: https://context7.com/gudastudio/groksearch/llms.txt Retrieves the full list of sources for a given web search session ID, including URL, title, description, and provider information. This tool is used in conjunction with the web_search tool. ```json # MCP tool call example # Tool name: get_sources # Parameter description: # session_id: str (required) - The session ID returned by web_search { "session_id": "a1b2c3d4e5f6" } ``` -------------------------------- ### Add Grok Search MCP to Claude Source: https://github.com/gudastudio/groksearch/blob/main/README.md Command to register the Grok Search MCP with Claude Code, including required environment variables. ```bash claude mcp add-json grok-search --scope user '{ "type": "stdio", "command": "uvx", "args": [ "--from", "git+https://github.com/GuDaStudio/GrokSearch@grok-with-tavily", "grok-search" ], "env": { "GROK_API_URL": "https://your-api-endpoint.com/v1", "GROK_API_KEY": "your-grok-api-key", "TAVILY_API_KEY": "tvly-your-tavily-key", "TAVILY_API_URL": "https://api.tavily.com" } }' ``` -------------------------------- ### Configuration and Diagnostics API Source: https://github.com/gudastudio/groksearch/blob/main/README.md Provides access to configuration settings and diagnostic information, including API connection tests and available model lists. ```APIDOC ## GET /get_config_info ### Description Retrieves all configuration statuses, tests the Grok API connection, and lists available models. API keys are automatically redacted. ### Method GET ### Endpoint /get_config_info ### Parameters None ### Response #### Success Response (200) - **config_status** (object) - Details about the current configuration. - **api_connection_test** (object) - Results of the Grok API connection test. - **available_models** (array) - List of available Grok model IDs. #### Response Example ```json { "config_status": { "grok_api_url": "http://your-grok-proxy.com/v1", "tavily_api_key": "***" }, "api_connection_test": { "success": true, "message": "Connection successful." }, "available_models": [ "grok-4-fast", "grok-2-latest" ] } ``` ``` -------------------------------- ### Model Switching API Source: https://github.com/gudastudio/groksearch/blob/main/README.md Allows switching the active Grok model. The selected configuration is persisted to `~/.config/grok-search/config.json` for cross-session consistency. ```APIDOC ## POST /switch_model ### Description Switches the active Grok model. The setting is persisted across sessions. ### Method POST ### Endpoint /switch_model ### Parameters #### Request Body - **model** (string) - Required - The ID of the model to switch to (e.g., "grok-4-fast", "grok-2-latest"). ### Request Example ```json { "model": "grok-4-fast" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the model switch. #### Response Example ```json { "message": "Model switched to grok-4-fast. Configuration saved." } ``` ``` -------------------------------- ### 切换 Grok 模型 Source: https://context7.com/gudastudio/groksearch/llms.txt 使用 switch_model 工具切换默认模型,配置将持久化保存。 ```json { "model": "grok-2-latest" } ``` ```json { "model": "grok-vision-beta" } ``` -------------------------------- ### web_fetch - Web Content Scraping Source: https://context7.com/gudastudio/groksearch/llms.txt Fetches complete web page content and returns it in Markdown format using Tavily Extract API. Falls back to Firecrawl Scrape if Tavily fails, with a mechanism for handling empty content and retries. ```APIDOC ## web_fetch - Web Content Scraping Fetches complete web page content and returns it in Markdown format using Tavily Extract API. Falls back to Firecrawl Scrape if Tavily fails, with a mechanism for handling empty content and retries. ### Parameters #### Request Body - **url** (string) - Required - The target web page URL. ### Request Example ```json { "url": "https://docs.python.org/3/whatsnew/3.12.html" } ``` ### Response Example (Success - Markdown) ```markdown # What's New In Python 3.12 ## Summary – Release Highlights Python 3.12 is the latest stable release of the Python programming language... ### Type Parameter Syntax Generic classes and functions can now be declared using a new syntax... ```python def max[T](args: Iterable[T]) -> T: ... ``` ``` ### Error Handling Examples **Missing API Keys:** ```json { "url": "https://example.com/protected-page" } ``` *Response:* `"配置错误: TAVILY_API_KEY 和 FIRECRAWL_API_KEY 均未配置"` **Scraping Failure:** *Response:* `"提取失败: 所有提取服务均未能获取内容"` ``` -------------------------------- ### Search Planning API Source: https://github.com/gudastudio/groksearch/blob/main/README.md Generates a structured search plan for complex, multi-stage, or multi-turn searches before execution. ```APIDOC ## POST /search_planning ### Description Generates a structured search plan for complex searches, enabling multi-stage and multi-turn execution. ### Method POST ### Endpoint /search_planning ### Parameters #### Request Body - **query** (string) - Required - The complex search query or objective. - **stages** (int) - Optional - The number of planned stages for the search. ### Request Example ```json { "query": "Research the impact of climate change on global agriculture over the next decade, considering economic and policy factors.", "stages": 3 } ``` ### Response #### Success Response (200) - **plan** (object) - A structured search plan with defined stages and actions. #### Response Example ```json { "plan": { "stage_1": { "description": "Initial broad search on climate change impacts.", "actions": ["web_search(query='climate change global agriculture impact')"] }, "stage_2": { "description": "Investigate economic factors.", "actions": ["web_search(query='economic impact climate change agriculture')"] }, "stage_3": { "description": "Analyze policy implications.", "actions": ["web_search(query='policy response climate change agriculture')"] } } } ``` ``` -------------------------------- ### web_map - Site Structure Mapping Source: https://context7.com/gudastudio/groksearch/llms.txt Crawls website structure using Tavily Map API to discover URLs and generate a sitemap. Supports natural language filtering, depth control, and breadth limitations. ```APIDOC ## web_map - Site Structure Mapping Crawls website structure using Tavily Map API to discover URLs and generate a sitemap. Supports natural language filtering, depth control, and breadth limitations. ### Parameters #### Request Body - **url** (string) - Required - The starting URL. - **instructions** (string) - Optional - Natural language filtering instructions. - **max_depth** (integer) - Optional, defaults to 1, range 1-5 - Maximum traversal depth. - **max_breadth** (integer) - Optional, defaults to 20, range 1-500 - Maximum links to follow per page. - **limit** (integer) - Optional, defaults to 50, range 1-500 - Upper limit for total links processed. - **timeout** (integer) - Optional, defaults to 150, range 10-150 - Timeout in seconds. ### Request Example (Basic) ```json { "url": "https://docs.python.org/3/" } ``` ### Response Example (Success) ```json { "base_url": "https://docs.python.org/3/", "results": [ "https://docs.python.org/3/library/index.html", "https://docs.python.org/3/tutorial/index.html", "https://docs.python.org/3/reference/index.html" ], "response_time": 2.34 } ``` ``` -------------------------------- ### web_map - Site Structure Mapping Source: https://context7.com/gudastudio/groksearch/llms.txt Crawls website structures to discover URLs and generate a sitemap using the Tavily Map API. It supports natural language filtering instructions, depth control, breadth limits, and overall processing limits, with a configurable timeout. ```json # MCP tool call example # Tool name: web_map # Parameter description: # url: str (required) - Starting URL # instructions: str (optional) - Natural language filtering instructions # max_depth: int (optional, default 1, range 1-5) - Maximum traversal depth # max_breadth: int (optional, default 20, range 1-500) - Maximum links to follow per page # limit: int (optional, default 50, range 1-500) - Upper limit for total links processed # timeout: int (optional, default 150, range 10-150) - Timeout in seconds # Basic site mapping { "url": "https://docs.python.org/3/" } ``` -------------------------------- ### AI Web Search API Source: https://github.com/gudastudio/groksearch/blob/main/README.md Performs AI-driven web searches using the Grok API. It returns the main content of Grok's answer and a session ID for retrieving sources later. Sources are cached server-side and can be fetched using `get_sources`. ```APIDOC ## POST /web_search ### Description Performs an AI-driven web search using the Grok API. Returns Grok's answer content and a session ID for source retrieval. ### Method POST ### Endpoint /web_search ### Parameters #### Query Parameters - **query** (string) - Required - The search query. - **platform** (string) - Optional - Focus platform (e.g., "Twitter", "GitHub, Reddit"). Defaults to "". - **model** (string) - Optional - Specify Grok model ID. - **extra_sources** (int) - Optional - Number of additional sources to supplement (Tavily/Firecrawl, can be 0 to disable). Defaults to 0. ### Request Example ```json { "query": "latest AI advancements", "platform": "GitHub, Reddit", "extra_sources": 2 } ``` ### Response #### Success Response (200) - **session_id** (string) - The session ID for the current query. - **content** (string) - The main content of Grok's answer, with sources stripped. - **sources_count** (int) - The number of cached sources. #### Response Example ```json { "session_id": "sess_abc123", "content": "Grok's answer content here...", "sources_count": 5 } ``` ``` -------------------------------- ### Disable built-in Claude tools Source: https://github.com/gudastudio/groksearch/blob/main/README.md Instruction to disable Claude Code's native search tools in favor of the Grok Search MCP. ```text 调用 grok-search toggle_builtin_tools,关闭Claude Code's built-in WebSearch and WebFetch tools ``` -------------------------------- ### Web Content Fetch API Source: https://github.com/gudastudio/groksearch/blob/main/README.md Fetches the complete content of a webpage in Markdown format using the Tavily Extract API. Falls back to Firecrawl Scrape if Tavily fails. ```APIDOC ## POST /web_fetch ### Description Fetches the complete content of a given URL in Markdown format. Uses Tavily Extract API with a fallback to Firecrawl Scrape. ### Method POST ### Endpoint /web_fetch ### Parameters #### Request Body - **url** (string) - Required - The URL of the target webpage. ### Request Example ```json { "url": "http://example.com/page" } ``` ### Response #### Success Response (200) - **content** (string) - The webpage content in Markdown format. #### Response Example ```json { "content": "# Page Title\n\nThis is the content of the webpage in Markdown." } ``` ``` -------------------------------- ### Site Structure Mapping API Source: https://github.com/gudastudio/groksearch/blob/main/README.md Crawls website structure using the Tavily Map API to discover URLs and generate a sitemap. ```APIDOC ## POST /web_map ### Description Crawls a website's structure to discover URLs and generate a sitemap using the Tavily Map API. ### Method POST ### Endpoint /web_map ### Parameters #### Request Body - **url** (string) - Required - The starting URL for the crawl. - **instructions** (string) - Optional - Natural language filtering instructions. Defaults to "". - **max_depth** (int) - Optional - Maximum crawl depth (1-5). Defaults to 1. - **max_breadth** (int) - Optional - Maximum links to follow per page (1-500). Defaults to 20. - **limit** (int) - Optional - Upper limit for total links processed (1-500). Defaults to 50. - **timeout** (int) - Optional - Timeout in seconds (10-150). Defaults to 150. ### Request Example ```json { "url": "http://example.com", "max_depth": 2, "instructions": "Only follow links related to products." } ``` ### Response #### Success Response (200) - **sitemap** (array) - A list of discovered URLs. #### Response Example ```json { "sitemap": [ "http://example.com/page1", "http://example.com/products/item1" ] } ``` ``` -------------------------------- ### web_search - AI-Powered Web Search Source: https://context7.com/gudastudio/groksearch/llms.txt Performs an AI-driven web search using the Grok API. It automatically injects local time context for time-related queries and returns structured results including session_id, content, and source count. Sources are cached server-side by session_id and can be retrieved using the get_sources tool. ```json # Basic search { "query": "FastAPI 最新版本有什么新特性" } ``` ```json # Platform-specific search { "query": "Claude Code 使用技巧", "platform": "GitHub, Reddit" } ``` ```json # Search with specified model and extra sources { "query": "2024年最新AI论文趋势", "model": "grok-4-fast", "extra_sources": 5 } ``` -------------------------------- ### web_search - AI Web Search Source: https://context7.com/gudastudio/groksearch/llms.txt Performs AI-driven web searches using the Grok API, automatically injecting local time context for time-sensitive queries. Returns structured responses with session IDs, content, and source counts. ```APIDOC ## web_search - AI Web Search Performs AI-driven web searches using the Grok API, automatically injecting local time context for time-sensitive queries. Returns structured responses with session IDs, content, and source counts. Sources are cached server-side by session_id and can be retrieved using the `get_sources` tool. ### Parameters #### Query Parameters - **query** (string) - Required - The search query string. - **platform** (string) - Optional - Focus platform, e.g., "Twitter", "GitHub, Reddit". - **model** (string) - Optional - Specify the Grok model ID. - **extra_sources** (integer) - Optional, defaults to 0 - Number of additional sources to supplement (Tavily/Firecrawl). ### Request Example ```json { "query": "FastAPI 最新版本有什么新特性" } ``` ### Response Example (Success) ```json { "session_id": "a1b2c3d4e5f6", "content": "FastAPI 最新版本 0.115.x 引入了多项新特性...", "sources_count": 5 } ``` ### Example with Platform and Extra Sources ```json { "query": "2024年最新AI论文趋势", "model": "grok-4-fast", "extra_sources": 5 } ``` ``` -------------------------------- ### Built-in Tools Routing Control API Source: https://github.com/gudastudio/groksearch/blob/main/README.md Controls the routing of built-in tools like WebSearch and WebFetch. Modifies the `permissions.deny` setting in `.claude/settings.json`. ```APIDOC ## POST /toggle_builtin_tools ### Description Controls the routing of built-in tools (WebSearch, WebFetch). Modifies project-level settings. ### Method POST ### Endpoint /toggle_builtin_tools ### Parameters #### Request Body - **action** (string) - Optional - Action to perform: "on" to disable official tools, "off" to enable official tools, or "status" to view the current status. Defaults to "status". ### Request Example ```json { "action": "off" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message about the action taken or the current status. #### Response Example ```json { "message": "Built-in tools are now enabled." } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.