Skip to main content
Glama

search_files

Read-onlyIdempotent

Recursively search text across files in an absolute local directory, with a configurable result limit to narrow matches.

Instructions

Search text recursively from an absolute local directory.

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": {
      "root": "<root>",
      "query": "<query>"
    },
    "name": "search_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootYes
limitNo
queryYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is fully covered by structured data. The description adds the useful constraints that traversal is recursive and the root must be absolute, but it says nothing about result ordering, binary file handling, or whether query is literal or pattern-based. Given the annotation coverage, a 3 is appropriate.

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?

A single front-loaded sentence with no filler or redundant restatement of the name. Every word carries information, and the most important qualifier (recursive, absolute) comes immediately after the verb.

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 three-parameter file-search tool with no output schema and no parameter descriptions, the definition should explain what query matches against and how limit bounds results. Neither is addressed, and the return shape (file paths, line matches, context lines) is left entirely unspecified, so an agent cannot predict call cost or output structure.

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?

Schema description coverage is 0% with three parameters, so the description must carry the burden; it partially does by implying root is an absolute local directory path. It adds nothing about query (literal string vs regex, case sensitivity) and never mentions limit, its default of 100, or its 500 maximum.

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 ("Search") plus the resource ("text") and adds scope qualifiers ("recursively", "absolute local directory"), so the agent knows this is a local filesystem text search rather than a remote or metadata lookup. It does not differentiate itself from siblings such as list_directory, file_info, or search_codex_history, which is why it stops short of a 5.

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

Usage Guidelines3/5

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

The phrase "absolute local directory" implies a precondition for use (a concrete path is required), which is lightly useful context. However, there is no statement of when to prefer this over list_directory or file_info, no exclusions, and no guidance on what to do if the path is relative or the directory does not exist.

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