Add an uploaded photo
add_photoFor agents that send files themselves: adds the photo sent to start_photo_upload's link to the business,
once it has arrived (photo_not_uploaded before), and with product_id to that product too, after its
last photo, when the plan has room for one more on it (otherwise plan_limit). Its type is read from the
file itself: anything but a JPEG, PNG, WebP, AVIF or HEIC photo is refused with photo_type_not_allowed.
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": {
"photo_id": "<photo_id>"
},
"name": "add_photo"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | No | The file's name on your computer, to recognise it by. | |
| photo_id | Yes | From Start uploading a photo. | |
| product_id | No | A product the photo joins, after its last photo. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| url | Yes | Where its sizes are, once ready: add `/{width}.webp` for a width in `webp_widths`, or `/{width}.avif` for one in `avif_widths`. | |
| width | Yes | Once ready: its width, turned upright. | |
| height | Yes | Once ready: its height, turned upright. | |
| status | Yes | uploaded until its sizes are made; ready after; failed when they could not be. | |
| filename | Yes | ||
| created_at | Yes | ||
| jpeg_width | Yes | Once ready: the width of its JPEG copy, under {media}/{business_id}/{id}/{width}.jpg, for drawing pages as pictures; null before, and for photos made before copies were. | |
| size_bytes | Yes | ||
| avif_widths | Yes | The widths made in AVIF, under {media}/{business_id}/{id}/{width}.avif. | |
| placeholder | Yes | Once ready: a tiny WebP as a data: URI, to show blurred while the photo loads; empty before. | |
| webp_widths | Yes | The widths made in WebP, under {media}/{business_id}/{id}/{width}.webp. | |
| content_type | Yes | Read from the file itself. |