Skip to main content
Glama
riverai

ebook-translator-mcp

by riverai

write_chunk_from_file

Store one translated chunk from a local UTF-8 .txt file in the Calibre ebook translation cache, using only a file path to avoid token costs and truncation.

Instructions

Write one chunk's translation from a local text (.txt) file — the recommended path for large translations. The agent passes only a file path, never the content: zero token cost for the text and no risk of truncation or mutation in transit. Whatever is in the file is exactly what gets stored (the local file is the source of truth, the cache is the mirror).

File handling: the file must exist and be valid UTF-8. A UTF-8 BOM is stripped automatically; leading/trailing whitespace is stripped exactly like write_chunk; and — with the default LF-based alignment separator — CRLF/CR line endings are normalized to LF (text stored with CRLF could never match an LF separator and every multi-block chunk would be flagged misaligned). If the configured separator itself contains CR, line endings are preserved verbatim instead. Empty or whitespace-only files are rejected. Relative paths resolve against the server process's working directory, which may differ from the caller's — absolute paths are strongly recommended (the resolved path is echoed back as source_file so mismatches are visible).

The response has the same structure as write_chunk (written / characters / alignment / progress / warning), plus source_file. After writing, the stored text is read back and compared inside this tool: if verify_mismatch is present (true), the stored text differs from the file — do not trust the write; inspect with get_translation and retry. overwrite=False skips chunks that already have a translation. 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.7/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden — and it does: BOM stripping, whitespace stripping, CRLF/CR normalization conditional on the separator, rejection of empty files, relative-path resolution against the server CWD, read-back verification with verify_mismatch, and overwrite semantics. This is unusually rich behavioral disclosure for a mutation tool.

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?

Front-loaded with purpose and value, then organized into file handling, response, and parameter notes. It is long, but nearly every clause carries actionable constraint information rather than filler; the length is defensible for a 0%-coverage schema.

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?

Given four parameters, no annotations, and a genuinely complex file/encoding/alignment contract, the description supplies everything an agent needs: input preconditions, normalization rules, failure signal (verify_mismatch), and idempotency behavior. It even explains the response shape despite an output schema existing.

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 coverage is 0%, so the description must compensate, and it covers all four parameters: file_path (must exist, valid UTF-8, path resolution rules), overwrite (skips already-translated chunks), chunk_id (this book's database cache id, cross-referenced to list_chunks), and book_id (echoed back for verification).

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?

States a specific verb, resource, and input source: write one chunk's translation from a local .txt file. It immediately distinguishes itself from the sibling write_chunk by naming the file-based path and its recommendation for large translations.

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

Usage Guidelines4/5

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

Explicitly frames when to prefer this over the inline alternative ('the recommended path for large translations') and the zero-token/truncation rationale. It also gives operational conditions: absolute paths strongly recommended, overwrite=False skips existing translations. It stops short of a formal when-not-to-use rule routing back to write_chunk.

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