datafile search

File Search

file_search

Searches text files in a local directory for a literal query. Returns bounded matching paths, line numbers, and excerpts while respecting common ignored directories. Use when: locating data fields, config values, references, or documentation across a project. Scope: local filesystem only. Read-only. Searches at most 2,000 files and returns at most 200 matches. Not for: scanning for secrets or PII (use repo_scanner), or searching remote repositories.

How to use file_search

Provide only the required inputs below. Start with the smallest scope that answers the task, then review the risk properties before an agent executes the call.

Risk and execution properties

Read only: yes

Destructive: no

Idempotent: yes

Open world: no — operates locally or through configured services

Inputs

pathstringrequired

Directory to search.

querystringrequired

Literal text to match, case-insensitively by default.

case_sensitiveboolean

Match case exactly. Default: false.

Default: false

file_extensionsarray

Optional extensions such as ['.py', '.json', '.md'].

max_resultsinteger

Maximum matches to return. Default: 50. Max: 200.

Default: 50

Example input

{
  "path": "<string>",
  "query": "<string>",
  "case_sensitive": false,
  "file_extensions": "<array>",
  "max_results": 50
}

Browse or search the full 74-tool reference to choose the smallest suitable capability.

Browse all tools →