Skip to main content
Glama

Translate a file

translate_file

Translate whole files into another language, preserving layout, tables, images, and formulas. Works with documents, subtitles, images, audio, and video.

Instructions

Translate a whole file into another language and save the result, keeping its layout, tables, images and formulas. Documents (pdf, docx, pptx, xlsx, epub, html, txt), subtitles (srt, vtt), pictures (jpg, png, webp, bmp), and recordings (mp3, m4a, wav, flac, ogg, aac, opus, mp4, mov, webm, mkv), which come back as translated subtitles. Answers with the paths written, never the contents. COSTS THE USER'S CREDITS: say what it will cost and get their agreement first -- estimate_cost gives the number for a file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceNoThe file: an absolute path on this machine, or a public http(s) URL (fetched by Equalang, not downloaded here). Omit when passing file_id.
file_idNoA file already uploaded by estimate_cost, instead of source: starts the job without uploading again.
bilingualNoSubtitles and recordings only: keep the original line above each translated one.
output_dirNoDirectory for the results. Defaults to beside a local source. A URL source has no "beside": without this the answer carries temporary links.
wait_secondsNoSeconds to wait before answering with a job_id instead (default 50, at most 240).
output_formatsNoRecordings only: the formats to write (default srt).
source_languageNoLanguage of the file; omit to detect it.
target_languageYesLanguage to translate into. A language code such as en, zh-CN, zh-TW, ja, ko, es, fr, de. list_languages has the codes: fewer for files than for text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.4

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations, the description discloses that the tool consumes user credits, requires prior agreement, saves the result, preserves layout, and returns paths rather than contents. This is critical behavioral information that the annotations alone do not provide.

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

Conciseness5/5

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

The description is front-loaded with the core purpose, then supported types, then output behavior, then cost warning. Every sentence carries information not already in the structured schema, and the file-type list earns its place because it constrains valid source inputs.

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

Completeness4/5

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

For an 8-parameter tool with no output schema, the description covers the most critical operational details: cost, output format, and file support. It could have been more explicit about the source/file_id requirement and what to do when a job_id is returned, though the schema descriptions and sibling tools such as check_job and cancel_job partially cover that.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds value by listing the accepted file extensions for source and clarifying the behavior for recordings. This helps an agent validate source inputs and understand how output_formats and bilingual apply.

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 opens with a specific verb-and-resource statement: 'Translate a whole file into another language and save the result.' It enumerates the supported file categories and even clarifies that recordings return as translated subtitles, which clearly separates this from text-only or transcription-only siblings.

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?

It gives explicit operational guidance: cost must be stated and approved first, and estimate_cost is named as the source of the number. It also tells the agent what the response will contain (paths, never contents). However, it does not explicitly tell the agent when to prefer translate_text or transcribe_recording instead, so it falls just short of full when-not guidance.

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