refresh_search_tools
Re-detect available command-line search tools on the system to ensure newly installed tools are recognized by the code-index-mcp server for efficient code indexing and analysis.
Instructions
Manually re-detect the available command-line search tools on the system. This is useful if you have installed a new tool (like ripgrep) after starting the server.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"title": "refresh_search_toolsArguments",
"type": "object"
}
Implementation Reference
- src/code_index_mcp/server.py:306-313 (handler)MCP tool handler for 'refresh_search_tools'. This is the entry point registered with FastMCP that executes the tool logic by delegating to SearchService.@mcp.tool() @handle_mcp_tool_errors(return_type='str') def refresh_search_tools(ctx: Context) -> str: """ Manually re-detect the available command-line search tools on the system. This is useful if you have installed a new tool (like ripgrep) after starting the server. """ return SearchService(ctx).refresh_search_tools()
- Core implementation logic for refreshing search tools. Calls settings.refresh_available_strategies() and returns the updated configuration status.def refresh_search_tools(self) -> str: """Refresh the available search tools.""" if not self.settings: raise ValueError("Settings not available") self.settings.refresh_available_strategies() config = self.settings.get_search_tools_config() available = config['available_tools'] preferred = config['preferred_tool'] return f"Search tools refreshed. Available: {available}. Preferred: {preferred}."