Keep an image for a document
upload_imageKeeps an image and returns its link, to use as or CSS url() in render_pdf, render_template, open_in_editor and update_document — so the document stays small when you read it back. Give one of: image — a picture the person attached in the chat, as your client passes attached files to tools; image_base64 — bytes you have yourself (one you made, a small file you can read: base64 is text you write, so tens of KB). PNG, JPEG, HEIC, GIF, WebP or AVIF; a photo over 10 MB or in HEIC is brought to print size (4096 px on the long side). A picture the person attached that you can see but have no file of: call ask_for_images, which gives them a link to upload it from their device. An image at a public https address needs no upload: use that address. An SVG goes into the HTML as it is. The image lasts 30 days after a document using it last changed.
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_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | No | A picture the person attached in the chat. | |
| image_base64 | No | The image's bytes, base64 (a data: URI is taken too). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The image's link, for <img src>. | |
| type | Yes | ||
| bytes | Yes | ||
| width | Yes | Pixels (0: not read from this format). | |
| height | Yes |