set_image_from_base64
Sets an inventory item's photo or the company logo from a small image sent inline as base64. Use this for a photo the user pasted into the chat when you can run code on the file but your sandbox can't reach this server (otherwise prefer get_image_upload_link, which keeps the full-size photo). Shrink the image first: the decoded image must be 150 KB or less. In Python: from PIL import Image; import io, base64, hashlib; im = Image.open(path); im.thumbnail((512, 512)); buf = io.BytesIO(); im.convert("RGB").save(buf, "JPEG", quality=80); data = buf.getvalue(); print(hashlib.sha256(data).hexdigest()); print(base64.b64encode(data).decode()). Copy the base64 exactly and pass the SHA-256 too, so a copying slip is caught instead of saving a broken image.
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": {
"target": "<target>",
"imageBase64": "<imageBase64>"
},
"name": "set_image_from_base64"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sha256 | No | Optional but recommended: the SHA-256 of the image bytes as hex, used to detect copying mistakes. | |
| target | Yes | "item" to set an inventory item's photo (also pass inventoryItemId), or "logo" to set the company logo. | |
| imageBase64 | Yes | The image bytes as base64 (a data:image/...;base64, prefix is allowed). | |
| inventoryItemId | No | The inventory item id when target is "item" (from get_inventory). |