Add a picture to a draft
add_draft_imageStores one picture for a draft and returns its key and the body line to put where it should show: . Give the picture as an https address (url), which Entry reads once and keeps a copy of, or as base64 (data, at most 2 MB). PNG, JPEG, GIF or WebP, at most 2 MB; EXIF and location are removed. Addresses that are private or blocked are refused. The owner's plan limits a post's pictures (3 on Free, 30 on Pro, counting pictures added and not yet used). The picture is in the post once a save writes the line in the body; one never used is deleted after a day. Embeds (an X post, a GitHub repository, a YouTube or Vimeo video or a video file) need no tool: write
on a line of its own. Requires the drafts:write scope. Publishing, unpublishing and changes to the live profile are made only by the owner, in Entry.
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": {
"entryId": "<entryId>",
"draftId": "<draftId>"
},
"name": "add_draft_image"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alt | No | The picture's description (alt text), read aloud by screen readers. Only used to write the returned line. At most 300 characters. | |
| url | No | An https address of the picture. Give this or data. | |
| data | No | The picture's bytes, base64 (a data: URL is accepted). At most 2 MB once decoded. Give this or url. | |
| caption | No | A caption shown under the picture. Only used to write the returned line. At most 200 characters. | |
| draftId | Yes | The draft's id (starts with drf_), as returned by list_drafts or create_draft. | |
| entryId | Yes | The Entry's id (starts with ent_), as returned by list_entries. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Only when the call failed (isError): the error code, e.g. conflict, forbidden, not_found, validation_failed, rate_limited. | |
| image | No | The stored picture: its key, the body line, its size and type. | |
| details | No | Only when the call failed: conflict has revision, forbidden has requiredScope, rate_limited has retryAfter (seconds), validation_failed has problems; a refused page bundle has errors (code, path, detail, fix for each) and a stale page revision has revision. | |
| message | No | Only when the call failed: what went wrong and what to do. |