Finalize Image Upload
finalize_image_uploadConfirm and validate an image that was PUT to a request_image_upload URL. Call this AFTER your PUT to upload_url completes. Zarla reads the staged bytes from its own storage, validates magic bytes (rejects non-JPEG/PNG/WebP), enforces 8000×8000 dim cap, strips EXIF, moves the file into Zarla's own image storage, and saves the image to the site's photo library (it will appear in My Photos and list_site_photos). Pass folder to also file it into a media-library folder — the way to make the photo show up in a gallery that's bound to that folder (editor updates immediately; the live site picks it up at the next publish_site). Returns {url, media_item_id, folder, mime, bytes, width, height} — pass the URL to update_block, update_business_info, or update_seo. Single-use: each asset_id can be finalized exactly once.
Annotations: read-only=false, destructive=false, idempotent=true, open-world=false. Why: Moves one staged upload into the site's photo library; nothing existing is overwritten (not destructive). Idempotent: a repeat finds the slot consumed and changes nothing. Closed-world: both the staging area and the photo library are Zarla's own storage — no third-party or user-controlled system is contacted.
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": {
"asset_id": "<asset_id>"
},
"name": "finalize_image_upload"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alt | No | Accessibility alt text — overrides what was passed to request_image_upload. | |
| folder | No | Media-library folder NAME to file the photo into (e.g. "Projects"). Matched case-insensitively against the site's existing folders; created if it doesn't exist. Use the folder a gallery is bound to when the user wants the photo to appear in that gallery. | |
| asset_id | Yes | The asset_id returned by request_image_upload |