write_file
Write content to a specified file with options to set encoding, overwrite existing files, and choose file paths relative or absolute in the Python environment.
Instructions
Write content to a file in the working directory or system-wide if allowed.
Args:
file_path: Path to the file to write (relative to working directory or absolute if system access is enabled)
content: Content to write to the file
overwrite: Whether to overwrite the file if it exists (default: False)
encoding: File encoding (default: utf-8)
Returns:
str: Status message about the file writing operation
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>",
"content": "<content>"
},
"name": "write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| encoding | No | utf-8 | |
| file_path | Yes | ||
| overwrite | No |