Write file
write_fileCreate or upload a file to Nextcloud via WebDAV. Optionally overwrite existing files or create missing parent folders.
Instructions
Create or upload a file over WebDAV PUT. Refuses to overwrite an existing file unless overwrite is true. Set parents true to create missing parent folders. Does not delete anything else.
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": {
"path": "<path>",
"content": "<content>"
},
"name": "write_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Destination path relative to the Nextcloud files root. | |
| content | Yes | File contents. UTF-8 text, or base64 when encoding is base64. | |
| parents | No | Create missing parent folders. Default false. | |
| encoding | No | utf8 (default) or base64. | |
| overwrite | No | Replace an existing file. Default false. | |
| contentType | No | Optional Content-Type. Defaults to text/plain or application/octet-stream. |