Skip to main content

upload_image

Adds an image to a project canvas from either base64 bytes (imageBase64, raw or a data: URL) or a public imageUrl the server fetches. Supported types: JPEG, PNG, GIF, WebP. Returns the new image item id.

Tool name: upload_image

Parameters

ParameterTypeRequiredDefaultDescription
projectIdstringYesTarget project (map) id.
imageBase64stringOne of theseImage bytes as base64 — raw, or a "data:image/...;base64,…" URL.
imageUrlstringOne of thesePublic URL of an image the server fetches and uploads.
fileNamestringNoDerivedFile name; derived from the URL or MIME type if omitted.
mimeTypestringNoDerivedMIME type, e.g. "image/png"; derived from the data/URL/extension when possible.
positionobjectNo{ x: 0, y: 0 }World-coordinate top-left, { x, y }.
sizeobjectNo{ width: 400, height: 300 }Display size in world coordinates, { width, height }.
parentIdstringNoProject canvasContainer id to place the image under.

Exactly one of imageBase64 or imageUrl must be provided. Unsupported MIME types are rejected with an error.

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.