Get an upload link for a big file
upload_fileFree. A tool request is capped at 4.5 MB in total, and inline base64 files count toward it (base64 adds a third). For a bigger file, or any local file you would rather not inline (a long voice track, a full-size photo, a video), call this first: it returns a one-time uploadUrl and the fileUrl the file will have. PUT the file's raw bytes to uploadUrl within 15 minutes with the returned content-type header (the response includes a ready curl command; up to 100 MB), then pass fileUrl in the tool's file field (for example image or audio) with run_tool. One file per link. The file is deleted once a call that used it succeeds, so upload again for each new call; if no call succeeds with it, it is deleted after 6 hours.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "upload_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | No | Optional instead of content_type: the file's name, e.g. 'voice.mp3'; its extension sets the type. | |
| content_type | No | The file's media type: image/jpeg, image/png, image/webp, image/gif, audio/mpeg, audio/wav, audio/flac, audio/ogg, audio/mp4, video/mp4, video/webm, video/quicktime or application/pdf. |