Skip to main content

upload_image

Add an image to a project canvas from either base64 bytes (imageBase64, raw or a data: URL) or a public imageUrl the server fetches (http/https on the public internet, redirects are not followed). Supported types: JPEG, PNG, GIF, WebP, read from the bytes; at most 25 MB. Returns the new image item id.

Tool name: upload_image

Parameters​

ParameterTypeRequiredDefaultDescription
projectIdstringYes—Target project (map) id.
imageBase64stringOne of these—Image bytes as base64 — raw, or a "data:image/...;base64,…" URL.
imageUrlstringOne of these—Public URL of an image the server fetches and uploads.
fileNamestringNoDerivedFile name; derived from the URL or MIME type if omitted.
mimeTypestringNoRead from the bytesDeclared MIME type, e.g. "image/png". The type is read from the image bytes either way.
positionobjectNo{ x: 0, y: 0 }World-coordinate top-left, { x, y }.
sizeobjectNo{ width: 400, height: 300 }Display size in world coordinates, { width, height }. When given, both are required and must be greater than 5.
parentIdstringNoProject canvasContainer id to place the image under.

Exactly one of imageBase64 or imageUrl must be provided. The image type is read from the bytes — JPEG, PNG, GIF or WebP; anything else is rejected whatever mimeType says — and an image may be at most 25 MB.

imageUrl must be an http or https URL on the public internet. The server refuses hosts that resolve to private, loopback, link-local or other non-public addresses, does not follow redirects, and gives up after 15 seconds.

note

The request body is limited to 25 MB, which caps the size of base64 uploads. For larger images prefer imageUrl.

Returns​

{
"created": true,
"itemId": "33cc44dd-...",
"fileName": "architecture.png",
"mimeType": "image/png"
}

Example​

"Put the architecture diagram from our wiki onto the board."

{
"projectId": "a1b2c3d4-...",
"imageUrl": "https://example.com/diagrams/architecture.png",
"position": { "x": 800, "y": 100 },
"size": { "width": 640, "height": 480 }
}

To read the image back later, use get_image_data.