Start a direct media upload
create_media_uploadGet a presigned URL to upload a file straight to storage — no base64 through this channel, no third-party host. Best for large files and production. The URL grants write access to this workspace’s own private storage for 10 minutes; it replaces nothing, and the file joins the media library only when attach_media records it. Flow: (1) call this with the contentType; (2) HTTP PUT the raw file bytes to the returned uploadUrl (e.g. curl -X PUT --data-binary @file -H "Content-Type: <type>" "<uploadUrl>"); (3) call attach_media with the returned storageKey to save it to the media library.
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": {
"contentType": "<contentType>"
},
"name": "create_media_upload"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | No | Original filename (for a nicer storage key) | |
| contentType | Yes | MIME type of the file, e.g. image/jpeg, image/png, video/mp4 | |
| workspaceId | No | Which workspace to act in — an id from list_workspaces. Optional with a single workspace; REQUIRED once there are several, where guessing would mean posting one client's content to another client's accounts. Ask the user which one before publishing. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| next | No | ||
| uploadUrl | No | ||
| storageKey | No | ||
| expiresInSec | No |