fs_search
Search the text files a project stores (source, JSON, markdown, HTML, CSS and similar; binaries are skipped). The answer's mode says how it searched:
fts5(normal): the project's search index. Each run of ASCII letters and digits in the query matches the start of a word, ignoring case. Results are{ path, snippet }, best first. Each write indexes the first 1,048,576 characters of a text file; when the index is built for files already stored, files over 1,048,576 bytes are skipped.scan(when the index is not ready or falls back, and for preview files): a literal, case-sensitive match, line by line, over at mostmax_filesfiles, skipping files over 1,048,576 bytes. Results are{ path, line, snippet, before, after }and the answer addsfiles_scanned. A production scan schedules index backfill.
truncated: true means the answer reached limit, so there may be more. A 503 FILE_INDEX_UNAVAILABLE means the index needs recovery; a later search succeeds once it recovers.
Example:
// Files that mention the auth client:
{ "project_id": "my-saas", "path": "/", "query": "createSomewhereAuth" }
// Scoped to a subtree:
{ "project_id": "my-saas", "path": "/src/api/", "query": "TODO" }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": {
"project_id": "<project_id>",
"query": "<query>"
},
"name": "fs_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Directory to search under (defaults to "/"). Trailing slash optional. | |
| limit | No | Max matches to return (default 50, cap 500). | |
| query | Yes | Text to search for, up to 500 characters. Indexed search matches words, ignoring case; the scan fallback matches it literally and case-sensitively. | |
| max_files | No | Max files the scan fallback reads (default 500, cap 2,000). Not used by indexed search. | |
| project_id | Yes | Project ID (UUID), subdomain, or slug — resolved server-side, no UUID lookup needed. 'default' also works when the account has exactly one project; multi-project accounts must name one (the error lists them). |