write_file_content
Write or update configuration files in authorized directories, creating a timestamped backup before overwriting to ensure safe changes.
Instructions
Atomically write or update a configuration file within authorized directories.
Creates an automatic timestamped backup (.bak.) before overwriting. Permitted directories: /etc/nginx/, /etc/mysql/, /etc/postgresql/, /etc/docker/, /etc/caddy/, /var/www/
Args: file_path: Path to the target configuration file. content: Text content to write. backup: Create a backup file before writing (default: True).
Returns: JSON string indicating write status and backup location.
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_content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| backup | No | ||
| content | Yes | ||
| file_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |