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").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| share_id | Yes | ||
| file_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |