Upload a photo
tinytales_images_write books:write
Add one photo to a draft book and queue a coloring page. Action: upload. JPEG, PNG, WebP, HEIC, or HEIF up to 10 MB. Undecodable, blank, or noise files are rejected.
00Actions
upload— needsbook_id,filename,media_type,image_base64. Scope:books:write.
01Access
The signed-in customer must have approved books:write. Calls stay inside that account.
02Annotations
The tool creates or updates records in the signed-in account.
The upload adds a page. The page can be deleted afterward. It does not erase the book.
This tool only reads or changes the signed-in TinyTales account. It does not post to the public internet or to other people’s services.
Repeating the call can create another record.
03Input
Which action to run: upload.
Book id from tinytales_books action list or tinytales_books_write action create.
File name including an extension, such as photo.jpg.
MIME type: image/jpeg, image/png, image/webp, image/heic, or image/heif.
Base64-encoded image bytes, without a data: prefix. Maximum decoded size is 10 MB.
json returns structured data. markdown returns the same data as a short readable summary. Defaults to json.
04Output
True when the underlying TinyTales route accepted the call.
One-line result for the model to read.
What to do next, in one sentence. Present when TinyTales knows a clear next action. Follow it before trying anything else.
Present when ok is false. Names the failed state and the next action to call.
05Errors
- Unsupported image type
- Image is too large
- The photo is undecodable
- The photo looks like pure noise or static
- The photo is nearly blank
- Generation is temporarily unavailable. Try again later.
- Book not found
- Photos can only be added before the book is published
06Example request
{
"action": "upload",
"book_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"filename": "lake.jpg",
"media_type": "image/jpeg",
"image_base64": "<base64>"
}
07Example response
{
"ok": true,
"summary": "Photo accepted and queued for a coloring page.",
"next_step": "Upload any remaining photos, then poll tinytales_books action progress every 15 seconds until inProgress is 0. Do not call process."
}