file.write
Writes a file on the daemon host in one call from text, JSON, artifact, or batch results, avoiding shell-chunk echoing; sanitizes file names, creates directories, and handles conflicts.
Instructions
Write a file on the daemon host in one call, instead of echoing content through a shell in chunks. Source is exactly one of content (text, or base64 with encoding), json (pretty-printed), artifact_id, or batch_id (a page.visit_batch run's results, partial if still running). The file name is sanitized for every OS (illegal characters, reserved names like CON, trailing dots, length); the directory must be absolute and is created. on_conflict: "rename" (default, writes "name (2).ext"), "error", or "overwrite" (atomic replace).
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": "file.write"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dir | No | Absolute directory; use with filename. | |
| json | No | ||
| path | No | Absolute path. Only the file name part is sanitized. | |
| content | No | ||
| batch_id | No | ||
| encoding | No | ||
| filename | No | File name, sanitized before use. Handy when it comes from a page title. | |
| artifact_id | No | ||
| on_conflict | No |