Skip to main content
File system tools cover the full lifecycle of working with files: reading content, creating or overwriting files, making targeted edits, searching by name, and searching by content.

Tool catalog

ToolDescriptionRead-only
FileReadToolRead file contents (text, images, PDFs, notebooks). Supports line ranges.Yes
FileWriteToolCreate or overwrite filesNo
FileEditToolPartial file modification via string replacementNo
GlobToolFind files matching glob patterns (e.g. **/*.ts)Yes
GrepToolContent search using ripgrep (regex-capable)Yes
NotebookEditToolEdit Jupyter notebook cellsNo
TodoWriteToolWrite to a structured todo/task fileNo

FileReadTool

Reads file contents and returns them to the agent. Supports multiple file types:
  • Text files — Source code, configuration, plain text
  • Images — Rendered inline in the terminal UI
  • PDFs — Extracted text content
  • Notebooks — Jupyter .ipynb files rendered as structured output
You can pass a line range to limit the output to a specific section of a large file:
FileReadTool({ path: 'src/index.ts', startLine: 10, endLine: 50 })
Use line ranges when working with large files to reduce context usage. Combine with GrepTool to find the relevant line numbers first.

FileWriteTool

Creates a new file or overwrites an existing file entirely. Use this when you need to replace a file’s full contents.
FileWriteTool overwrites existing files without diffing. For partial changes, use FileEditTool instead to avoid accidentally discarding content.

FileEditTool

Makes targeted edits to an existing file using string replacement. The agent provides an oldString and a newString; the tool replaces the first match of oldString with newString. This is the preferred tool for modifying existing files because:
  • It operates on a diff rather than the full file
  • It requires reading the file first, which reduces hallucinated changes
  • It preserves all content outside the edited region

GlobTool

Finds files whose paths match a glob pattern. Returns a list of matching paths sorted by modification time.
GlobTool({ pattern: '**/*.ts', path: 'src/' })
Common patterns:
PatternMatches
**/*.tsAll TypeScript files in any subdirectory
src/**/*.test.tsAll test files under src/
*.jsonJSON files in the current directory only
**/index.{ts,tsx}All index.ts or index.tsx files

GrepTool

Searches file contents using ripgrep. Supports full regular expressions and returns file paths with matching line numbers.
GrepTool({ pattern: 'buildTool\\(', include: '*.ts' })
Prefer GrepTool over BashTool with grep — it is faster on large codebases and the results are formatted for the agent’s context window.

NotebookEditTool

Edits individual cells in a Jupyter notebook (.ipynb). Operates on cell index and cell type (code, markdown, or raw).

TodoWriteTool

Writes structured todo items to the agent’s task file. Used by the agent to track multi-step work in progress. Supports statuses such as pending, in_progress, and completed.

Build docs developers (and LLMs) love