ssh_write_remote_file
Write remote files over SFTP atomically: create a temp file in the same directory, preserve existing permissions and ownership, then rename over the target, with an in-place fallback if needed.
Instructions
Write content to a remote file via SFTP (no shell escaping). Atomic: writes a temp file in the same dir, keeps the existing file mode/owner, then renames over the target. Falls back to an in-place write (with a warning) when the dir is not writable.
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": {
"server": "<server>",
"remote_path": "<remote_path>",
"content": "<content>"
},
"name": "ssh_write_remote_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Optional octal mode, e.g. "600" (default: existing file mode, else 644) | |
| server | Yes | Server alias from config.json (case-insensitive). Known aliases: (none configured) | |
| content | Yes | File content (UTF-8 text) | |
| remote_path | Yes | Remote file path to write |