Add a file to the library from a URL
upload_media_from_urlDownload a file that is already on the web and store it in this workspace’s library. Answers with an id for a block’s mediaIds, the same kind of id list_media returns.
A URL, never the bytes — there is no way to push a file through this server. So an image you generated and hosted, a link the user gave you, or anything in their CDN works; a picture that exists only on the user’s computer does not, and that one is theirs to upload in the app.
The URL must be https and reachable without a login. A link into the user’s own network or a private address is refused rather than fetched.
JPEG, PNG, WebP, GIF, MP4, MOV, PDF, VTT or SRT. Images up to 10 MB, video and PDFs up to 100 MB, subtitle files up to 5 MB. The bytes are checked against the type the server declared, so a .png that is really something else is refused now rather than at publish time.
Set altText in the same call whenever the file is a picture. It is what a reader who cannot see it gets, and it becomes the default description everywhere this file is attached — this is the only place it can be set, so skipping it makes an undescribed image the default. Say what is in the frame, not that it is a picture.
Storage is a stock, not a rate: this counts against the plan’s allowance until the file is deleted, which frees it again. Pass an idempotencyKey and reuse it verbatim if you retry, or a call that timed out becomes two copies of the same file.
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": {
"url": "<url>"
},
"name": "upload_media_from_url"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The https URL to download. Must be publicly reachable without a login. | |
| altText | No | What the picture shows, for a reader who cannot see it. | |
| fileName | No | What to call it in the library. Defaults to the last segment of the URL’s path. | |
| idempotencyKey | No | A key of your choosing that makes this call safe to retry: retrying with the SAME key replays the first outcome instead of doing the work twice. Reuse it verbatim on a retry, and never reuse it for a different request. |