Add an image from an address
upload_imageFetches a PNG or JPG from an https address and adds it to the site's media library, then returns its attachment_id, the change_set_id, the site's state_version, and the alt text. Call it when your user gives you a picture by address and wants it on the site; write the alt text yourself, one sentence in the site's language that says what the picture shows. It does not put the image on a page: call apply_change_set afterwards with the attachment_id as a number, for example as the imageId of a hero block. The address must be public, use https, answer without a redirect, and hold a file of at most 5 MB; an address that carries a value of the site, such as its phone number, is refused. No check runs on the alt text, so your user owns the wording. rollback_change_set undoes the upload. It costs no credits.
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>",
"alt": "<alt>",
"siteId": "<siteId>"
},
"name": "upload_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alt | Yes | The alternative text: one sentence in the site's language that says what the picture shows. | |
| url | Yes | An https address of a PNG or JPG file, at most 5 MB, that answers without a redirect. | |
| title | No | The title in the media library. Leave it out to use the file name. | |
| siteId | Yes | Site id from list_sites or create_site. |