Skip to main content
Glama

Search Files

search_files
Read-only

Finds a string or regex pattern across files in approved workspace directories to locate matching content.

Instructions

Search for a regex or string pattern across files in approved workspace directories.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "search_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNo
queryYes
max_resultsNo
case_sensitiveNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered. The description adds the meaningful constraint that searches are confined to approved workspace directories, which goes beyond the annotations, but it does not explain what 'approved' means, how results are ordered or truncated, or any limits.

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

Conciseness4/5

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

A single front-loaded sentence with no wasted words. It is efficient but so short that it leaves the gaps above unaddressed rather than being genuinely tight.

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

Completeness2/5

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

For a 4-parameter search tool with zero schema description coverage, the description should define the regex flavor, path semantics, and result-limit behavior. An output schema exists, so return values need not be described, but the input side remains largely undocumented.

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

Parameters3/5

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

Schema description coverage is 0%, so the description must compensate and only partly does: 'regex or string pattern' clarifies the query format and 'approved workspace directories' loosely maps to path. The meanings of max_results, case_sensitive, and the empty-string default for path are left entirely unexplained.

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

Purpose4/5

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

States a specific verb and resource (search for a regex or string pattern across files) plus a scope qualifier (approved workspace directories). An agent can tell what it does, though it never explicitly distinguishes itself from list_directory or fetch_url.

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

Usage Guidelines2/5

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

No when-to-use guidance, no stated alternatives, no prerequisites. The only hint is the restriction to 'approved workspace directories', which implies scope but does not tell the agent when this tool is the right pick over directory listing or URL fetching.

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