get a media upload url
assets_create-upload-urlGet a presigned upload URL for a local audio, video, or image file so you can upload its bytes and register the media as an asset.
Instructions
Get a presigned upload URL for a local audio, video or image file: step 1 of 2 for media that is not already at a public URL. PUT the raw bytes to the returned uploadUrl with exactly the declared Content-Type and byte size, then pass the returned url (not uploadUrl) to assets_create to register the asset; until then no asset exists. Not for a public https:// file or a social video link (pass those straight to assets_create), or for re-hosting an already saved video as an Edit Dialogue source (dialogue_upload-source, when available). Returns {uploadUrl, url, expiresIn}: expiresIn is the upload URL's lifetime in seconds; if it expires, request a new one. Spends no credits. Each call issues a new storage path behind a random prefix, so it never collides with an existing file; request a separate upload URL for each file. For example, it returns 422 when size exceeds your plan's upload limit, and assets_create returns 422 if nothing was uploaded.
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": {
"fileName": "<fileName>",
"contentType": "<contentType>",
"size": "<size>"
},
"name": "assets_create-upload-url"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| size | Yes | Exact file size as a whole number of bytes, up to 5GB; the PUT must send exactly this many bytes. Your plan's size limit is checked against it here, and again by assets_create on the uploaded file. | |
| fileName | Yes | Name of the local file with its extension, up to 255 characters. It only names the stored file: the extension is kept (lowercased), spaces become underscores and other special characters may be dropped. | |
| contentType | Yes | MIME type starting with audio/, video/ or image/, such as video/mp4; send the same value as the Content-Type header on the PUT. |