Skip to content

text-write

Write or overwrite a text file.

Category: Write-capable

Warning

This tool overwrites the target file without confirmation if it already exists. For edits to existing files, prefer text-edit — it is harder to accidentally discard content.

Parameters

filePath (required)
Absolute path to the file to write.
content (required)
The content to write. The file is written as UTF-8.

Behavior

  • If the file's parent directory does not exist, it is created automatically.
  • If a file already exists at filePath, it is overwritten completely.

Output

Wrote file successfully. on success.