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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
projectId | string | Yes | — | Target project (map) id. |
imageBase64 | string | One of these | — | Image bytes as base64 — raw, or a "data:image/...;base64,…" URL. |
imageUrl | string | One of these | — | Public URL of an image the server fetches and uploads. |
fileName | string | No | Derived | File name; derived from the URL or MIME type if omitted. |
mimeType | string | No | Derived | MIME type, e.g. "image/png"; derived from the data/URL/extension when possible. |
position | object | No | { x: 0, y: 0 } | World-coordinate top-left, { x, y }. |
size | object | No | { width: 400, height: 300 } | Display size in world coordinates, { width, height }. |
parentId | string | No | Project canvas | Container 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.