Skip to content

File Operations

Read, write, and edit local files.

← Prebuilt Tools overview

ToolExtraDescription
editorbaseView, search, and edit files line-by-line.
file_readbaseRead and parse local files (JSON, PDF, CSV, code, and more).
file_writebaseCreate or overwrite files with agent output.

editor

View, search, and edit files line-by-line.

python
from elsai_tools.editor import editor
ParameterTypeRequiredDescription
commandstrYesview, create, str_replace, insert, undo, pattern_replace, search
pathstrYesFile path
file_textstrNoFull file content (create)
insert_lineUnion[str, int]NoLine number for insert
new_strstrNoReplacement or insert text
old_strstrNoText to replace
patternstrNoRegex pattern

file_read

Read and parse local files (JSON, PDF, CSV, code, and more).

python
from elsai_tools.file_read import file_read
ParameterTypeRequiredDescription
pathstrYesFile path or comma-separated paths
modestrNoRead mode
offsetintNoStart line/byte offset
limitintNoMax lines/bytes to read

file_write

Create or overwrite files with agent output.

python
from elsai_tools.file_write import file_write
ParameterTypeRequiredDescription
pathstrYesTarget file path
contentstrYesFile content
appendboolNoAppend instead of overwrite

Copyright © 2026 Elsai Foundry.