Skip to main content
Glama
riverai

ebook-translator-mcp

by riverai

get_translation_to_file

Export a chunk's current translation to a local file and return only metadata, so agents can proofread, rework, or archive text without loading it into the conversation.

Instructions

Export one chunk's current translation to a local file and return only metadata — the text itself never enters the conversation. Mirrors get_translation (same metadata and alignment fields, same stripped text as the UI proofreading panel shows).

Typical uses:

  • Rework a yellow (misaligned) chunk without any bulk text through the agent: export the translation, fix the block count offline (editor or script — deterministic, zero tokens), write it back with write_chunk_from_file.

  • Migrate translations after changing engine / target language / merge settings (the plugin then creates a new cache file): export every chunk from the old cache, write them into the new one.

  • Hand the current draft to a human reviewer, or archive a book's translations as plain text.

The chunk must already have a translation (status translated); exporting an untranslated chunk is an error. File handling is the same as get_original_to_file: UTF-8 without BOM, LF; missing parent directories are created automatically; an existing file is not overwritten unless overwrite=True; the file is read back and verified (verify_mismatch appears only on mismatch). Relative paths resolve against the server process's working directory — absolute paths recommended. chunk_id is this book's database cache id (see list_chunks); the response echoes book_id and title — verify it is the intended book.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
book_idYes
chunk_idYes
file_pathYes
overwriteNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden and does so thoroughly: error on untranslated chunks, UTF-8 without BOM with LF endings, automatic creation of missing parent directories, no overwrite unless overwrite=True, read-back verification with verify_mismatch on mismatch, and relative paths resolving against the server process CWD. It also discloses that the response echoes book_id and title for identity verification.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action is front-loaded in the first sentence, and the bulleted uses keep the middle scannable. The parenthetical 'same metadata and alignment fields, same stripped text as the UI proofreading panel shows' is dense, and the file-handling paragraph packs several facts into one long sentence, but nothing is truly wasted.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values needn't be enumerated, and the description still flags verify_mismatch and the echoed fields. Combined with the precondition, file-format, and path-resolution details, an agent has everything needed to call this correctly on the first attempt.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must supply all parameter meaning, and it largely does: chunk_id is defined as this book's database cache id with a pointer to list_chunks, file_path semantics (absolute recommended, relative resolved against server CWD) are explained, and overwrite's default-True/False behavior is stated. book_id is only indirectly covered via the echo-and-verify instruction, which is a minor gap but readable in context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource ('Export one chunk's current translation to a local file') and immediately clarifies the key scope distinction: only metadata returns, the text never enters the conversation. This cleanly separates it from the sibling get_translation, which returns the text itself, and it names get_original_to_file for the shared file-handling model.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Three concrete 'typical uses' scenarios (reworking a misaligned chunk offline, migrating translations after engine/language changes, handing drafts to reviewers) make the when-to-use unambiguous, and the round trip is explicitly routed to write_chunk_from_file. The precondition 'The chunk must already have a translation (status translated)' plus the note that exporting an untranslated chunk is an error covers the when-not-to-use case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.