Build file index
build_indexRecords every entry under a folder into the offline index used by search queries; run it before searching or to refresh the index when files change.
Instructions
Record every entry under a folder in the offline index that search_index reads. Use when: before search_index, or to refresh it. Instead: search_index to query; walk_tree for the live state. Requires: --mcp-tools index. Behavior: writes index rows, never files; reads listings only. prune=true drops rows of files now gone. Linked folders are not followed; folders deeper than 50 levels go to unreadable. A cancelled run keeps its rows. Time limit: 30 min. Returns: {path, backend_id, recursive, indexed, pruned, truncated (max_files), complete, unreadable (folder paths)}.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "build_index"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | The folder to index (absolute, or relative to the MCP root). Default on the local backend: the MCP root; other backends need it. | |
| prune | No | Afterwards drop index rows below the folder whose file is gone. | |
| backend | No | Backend id from list_backends; omit for the default. | |
| path_b64 | No | path as base64 of its raw bytes, for non-UTF-8 names; replaces path. | |
| max_files | No | Visit at most this many entries (files and folders together); reaching it stops the walk and sets truncated=true. Default 1,000,000 on the local backend, 100,000 on a remote one. | |
| recursive | No | Also index the subfolders (false: the folder's own entries only). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| pruned | Yes | ||
| indexed | Yes | ||
| complete | Yes | ||
| recursive | Yes | ||
| truncated | Yes | ||
| backend_id | Yes | ||
| unreadable | No |