upsert_file
Automatically create or update files in shared folders, handling both new and existing files with a single operation.
Instructions
Create or update a file in a folder share.
Automatically detects whether the file exists:
Existing file -> updates content (PUT)
New file -> creates file and registers in folder metadata (POST)
This is the recommended way to write files to folder shares.
Args: share_id: UUID of the folder share. file_path: File path within the folder (e.g. "notes/todo.md"). content: Full text content to write.
Returns: JSON with doc_id, path, length, operation ("created" or "updated").
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": {
"share_id": "<share_id>",
"file_path": "<file_path>",
"content": "<content>"
},
"name": "upsert_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| share_id | Yes | ||
| file_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |