Skip to main content
Glama

Search Files

search_files
Read-onlyIdempotent

Locate files by glob filename pattern, optionally filtering results by a regular expression matched against file contents.

Instructions

Find files by glob name pattern and, optionally, a regular expression on their contents.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

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

Input Schema

NameRequiredDescriptionDefault
contentNoOptional regular expression that file contents must match
patternNoGlob pattern matched against the file name, e.g. *.java
directoryNoDirectory to search (defaults to the working directory)
recursiveNoRecurse into subdirectories (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and a closed-world scope, so the safety profile is covered. The description adds no behavior beyond that: it is silent on whether binary/hidden files are scanned, how results are capped, or what happens with an invalid regex, which matters for a search tool.

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 filler and no redundancy. It is efficient, though its brevity leaves gaps that other dimensions penalize rather than being a flaw of structure.

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

Completeness3/5

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

For a four-parameter, zero-required read-only search with a fully documented schema and no output schema, the definition is minimally sufficient. It omits what the results look like (file paths only, or matching lines) and what an argument-free invocation does, which an agent would want before calling it.

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 100%, with each of the four parameters documented including the '*.java' example and the recursive default. The description only restates that the pattern is a glob and that content matching is optional, so it adds no meaning beyond the schema and the baseline 3 applies.

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?

The description uses a specific verb ('Find') plus the target resource (files) and names the two matching mechanisms: glob on the name, regex on contents. This is enough to distinguish it from siblings like list_directory or compare_files, though it does not explicitly name any sibling.

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?

There is no when-to-use or when-not-to-use guidance, no mention of preferred alternatives for simpler listing (e.g. list_directory), and no prerequisites or caveats. The single 'optionally' hints that content matching can be added, but an agent gets no routing logic.

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