Skip to main content
Glama

Translate subtitles with a local LLM

translate_subtitles

Translate finished subtitle files into another language using a local LLM while preserving timing and leaving originals unchanged.

Instructions

Translate finished subtitles into another language with the LLM running on the user's own computer (Ollama, LM Studio, llama-server, ...). Timing is kept; the original file is not changed.

path: absolute path to the .json written by transcribe (best), or an .srt / .vtt. target: language code or name: th, ja, es, de, "Thai", ... formats: comma list from srt, vtt, txt, json, ass for the translated files (NAME..srt, ...). llm_url: OpenAI-compatible endpoint, e.g. http://127.0.0.1:11434/v1; empty = the usual local ports. model: model name to ask for; empty = the first one the endpoint lists. Returns the files written, the number of subtitles, the language code, and the model used. If no local LLM is running, the error says how to start one; you can also translate the text yourself instead.

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": {
      "path": "<path>",
      "target": "<target>"
    },
    "name": "translate_subtitles"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
modelNo
targetYes
formatsNosrt
llm_urlNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.0

TDQS

A4.5/5.0
Behavior4/5

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

Adds substantial context beyond the annotations: new files are written under NAME.<code>.<ext> rather than mutating the source, timing is carried over, and a missing-endpoint failure surfaces a startup hint. The readiness requirement (an OpenAI-compatible local endpoint) is disclosed with example URLs. The one gap is what happens when an output file already exists, which matters given destructiveHint=false and idempotentHint=false.

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?

Purpose is front-loaded in the first sentence and the per-parameter lines are tight, each contributing distinct information. The parenthetical backend list "(Ollama, LM Studio, llama-server, ...)" is slightly padded, and the return-value sentence could be shorter, but nothing is genuinely redundant.

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?

There is no output schema, but the description compensates by enumerating the return payload (files written, subtitle count, language code, model used). Combined with the input-source guidance, the local-endpoint prerequisite, and the self-translate fallback, an agent has everything needed to invoke this correctly or to recover from the common failure.

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 carries the full burden, and it does: every one of the five parameters is explained with meaning and defaults. It adds real semantics the schema lacks - absolute path with accepted extensions and a preferred source, target as code or name with examples, formats as a comma list with the resulting filename pattern, empty llm_url meaning "usual local ports," and empty model meaning "first one the endpoint lists."

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 and resource ("Translate finished subtitles into another language") plus the execution model (local LLM on the user's machine) and two concrete guarantees: timing is preserved and the original file is untouched. The reference to "the .json written by transcribe" also distinguishes it from the transcribe sibling in the pipeline.

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?

Gives clear context for when to use it - after subtitles exist - and marks the transcribe .json as the preferred input ("(best)") over .srt/.vtt. It also offers an explicit fallback if no LLM is running ("you can also translate the text yourself instead"). It stops short of an explicit when-not or of naming sibling alternatives such as convert_subtitles, so it falls just short of a 5.

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