Skip to Content

fs_search

Find files under a folder by name pattern (*, ?) and/or by plain text inside them; returns paths, and with content the first matching line. Bounded: depth 12 by default, 200 matches by default, 20 s at most; symlinks are not followed; folders holding keys and credentials are skipped. Hidden names only with hidden=true.

Arguments

Over MCP every tool also takes machine: the machine’s name or id, optional when only one machine is online.

NameTypeRequiredMeaning
contentstringnoText to find inside files (plain text, not a regular expression). Files over 4 MiB and files that are not text are skipped. Default: match by name only.
hiddenbooleannoAlso enter and match names starting with a dot. Default: false.
ignore_casebooleannoCompare name and content ignoring letter case. Default: false.
limitintegernoAt most this many matches (default 200, at most 2000).
max_depthintegernoFolder levels below root to enter (default 12, at most 64).
namestringnoFile name pattern with * and ?, matched against the name only, for example *.rs. Default: every name.
rootstringyesFolder to search under. Absolute, or relative to the user’s home folder.

Result

NameTypeRequiredMeaning
matchesobject[]yes
rootstringyesThe root, resolved to an absolute path.
scannedintegeryesFiles looked at.
truncatedbooleanyesStopped early: the limit, the time cap (20 s) or the file count cap was reached.

Examples

{ "name": "fs_search", "arguments": { "machine": "<machine>", "root": "<root>" } }

Limits

The call times out after 30 s (timed_out). Available since version 0.0.1. A refused or failed call returns one of the error codes.