Upload image from the chat
upload_imageUse this when the user has a LOCAL image (pasted into the chat, or a file on their machine) that they want on a page. In chat apps that show views it opens an upload box in the chat where the user drops the image; it uploads straight to the project's media library and returns the asset URL, which you then set as a section media.src. In clients without views (terminal clients such as Claude Code) it returns a one-time curl command that uploads a local file by its path instead; pass command: true to always get that command when you can run shell commands and the file is on this machine. Prefer this over upload_asset for user-supplied local images (a pasted image's bytes never reach you, so you cannot upload it yourself). For an image that already has a public URL, use upload_asset(sourceUrl) instead.
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": {
"projectId": "<projectId>"
},
"name": "upload_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | No | true when you can run shell commands and the image is a file on this machine: the reply carries uploadCommand even where an upload box would show. Leave it out in chat apps. | |
| projectId | Yes | The project ID |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expiresAt | Yes | ||
| projectId | Yes | ||
| uploadCommand | No | One-time curl command that uploads a local file by its path; only where no upload box shows | |
| uploadEndpoint | Yes |