Delphidelphi

Read / Write / Edit

Read and modify files in the agent's workspace.

Read

Reads a file and returns its contents.

NameTypeRequiredDescription
file_pathstringAbsolute path to the file
limitnumberNumber of lines to read
offsetnumberLine number to start from
{ "file_path": "/home/user/project/README.md", "limit": 50 }

Write

Creates or overwrites a file with new content.

NameTypeRequiredDescription
file_pathstringAbsolute path to write
contentstringFull file content
{ "file_path": "/home/user/project/notes.md", "content": "# Notes\n\nMeeting at 3pm." }

Edit

Replaces a specific string within an existing file.

NameTypeRequiredDescription
file_pathstringAbsolute path to the file
old_stringstringExact text to find and replace
new_stringstringReplacement text
replace_allbooleanReplace all occurrences (default: false)
{
  "file_path": "/home/user/project/config.py",
  "old_string": "DEBUG = False",
  "new_string": "DEBUG = True"
}
Edit fails if old_string is not found in the file. Read the file first to confirm the exact text.