write_chunk
Writes a translated chunk to a book's cache, verifies alignment and readback, and warns on mismatches so agents can translate ebooks without manual copy-paste.
Instructions
Write the full translation of one chunk (stripped before writing, matching plugin behavior; engine name and target language are recorded). chunk_id is this book's database cache id (never changes; see list_chunks; valid only inside this book). Right after writing, the tool replicates the UI alignment check and returns the aligned state — mismatched block counts come with a warning (the chunk will be highlighted yellow in the UI), and the stored text is read back and verified (verify_mismatch appears only if it differs). With overwrite=False an existing translation is skipped. The response echoes book_id and title: writing is irreversible, verify it is the intended book first. For very large translations prefer write_chunk_from_file (file-based: zero content tokens, no truncation risk).
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": {
"book_id": "<book_id>",
"chunk_id": "<chunk_id>",
"translation": "<translation>"
},
"name": "write_chunk"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| book_id | Yes | ||
| chunk_id | Yes | ||
| overwrite | No | ||
| translation | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||