Skip to main content
Glama

Search files

search_files
Read-onlyIdempotent

Search text files in a workspace line by line like grep, skipping hidden directories and binary files. Filter matches by glob, regex, case sensitivity, and max count.

Instructions

Search text files in the workspace line by line, like grep.

Hidden directories and binary files are skipped.

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
globNoOnly search files whose name matches.*
pathNoFile or directory to search in..
queryYesText (or regex, see `regex`) to look for.
regexNoTreat query as a Python regex.
max_resultsNo
case_sensitiveNo

Output Schema

NameRequiredDescriptionDefault
queryYes
matchesYes
truncatedYes
files_scannedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, closed-world), so credit goes for the added disclosure that hidden directories and binary files are skipped, which materially shapes result expectations. It still does not mention truncation at max_results or pagination behavior.

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?

Two short sentences, front-loaded with the core purpose and followed by the most decision-relevant caveat. No filler, though the grep clause is slightly redundant with "line by line".

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

Completeness5/5

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

With an output schema present, return values need no explanation, and annotations file the safety profile. The description supplies the one thing structured fields do not: which files are silently excluded from results.

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 coverage is 67%, so the schema carries most parameter meaning; the description adds no syntax, default, or format detail beyond it. It does not, for example, clarify matching semantics for glob or what path resolution means when path is a directory.

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 text files in the workspace line by line") and anchors the behavior with a concrete analogy, "like grep". This clearly separates it from read_file or list_files, though no sibling is named explicitly.

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?

Usage is only implied through the grep analogy — an agent can infer this is for content matching rather than listing or reading. There is no explicit statement of when to prefer it over list_files or read_file, and no exclusions.

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