Skip to main content
Glama

refresh_search_tools

Manually re-detect available command-line search tools on your system to update the tool list after installing new ones.

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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The core handler: refresh_search_tools() on SearchService calls settings.refresh_available_strategies() to re-detect available CLI search tools, then returns the updated tool list and preferred tool.
    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}."
  • Registers 'refresh_search_tools' as an MCP tool via @mcp.tool() decorator. Delegates to SearchService.refresh_search_tools().
    @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()
  • ProjectSettings.refresh_available_strategies() – triggers rescanning of installed CLI tools by calling _get_available_strategies().
    def refresh_available_strategies(self):
        """
        Force a refresh of the available search tools list.
        """
    
        self.available_strategies = _get_available_strategies()
  • _get_available_strategies() – iterates the priority-ordered SEARCH_STRATEGY_CLASSES, instantiates each, and collects those that are available on the system.
    def _get_available_strategies() -> list[SearchStrategy]:
        """
        Detect and return a list of available search strategy instances,
        ordered by preference.
        """
        available = []
        for strategy_class in SEARCH_STRATEGY_CLASSES:
            try:
                strategy = strategy_class()
                if strategy.is_available():
                    available.append(strategy)
            except Exception:
                pass
        return available
  • get_search_tools_config() – returns the available_tools list and preferred_tool name, used to format the output of refresh_search_tools.
    def get_search_tools_config(self):
        """Get the configuration of available search tools.
    
        Returns:
            dict: A dictionary containing the list of available tool names.
        """
        return {
            "available_tools": [s.name for s in self.available_strategies],
            "preferred_tool": self.get_preferred_search_tool().name
            if self.available_strategies
            else None,
        }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Describes the action (re-detect) but lacks detail on side effects (e.g., overwriting custom settings) or return behavior. With no annotations, description carries full burden and is adequate but minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with purpose, no unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple 0-parameter tool with output schema, the description gives enough context to understand when to use it. Lacks description of output, but schema covers that.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist; schema coverage is trivial 100%. Description adds no param info, which is appropriate. Baseline of 4 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses specific verb 're-detect' and resource 'available command-line search tools', clearly distinguishing it from sibling tools that perform actual searches.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states a use case: after installing a new tool like ripgrep. Does not explicitly contrast with siblings but context implies it's for manual refresh when auto-detection fails.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/johnhuang316/code-index-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server