MCP Tools

translate_missing

Find the keys missing in the target locales and translate them. Without a translation backend nothing is written: the result carries per-locale fallback contexts to translate by hand instead. Two modes: in provider mode (the server env-configured with I18N_PROVIDER, I18N_MODEL and an API key) it calls the LLM provider directly and writes the results; in agent mode it returns those fallbackContexts — translate them inline and persist via write_translations. Check the discover output for the active mode. Uses the project config (glossary, translation prompt, locale notes, examples) where there is one. Translates all locales concurrently, so pass every target locale at once.

Parameters

ParameterTypeRequiredDescription
layerstringnoLayer to translate (e.g., "root", "app-admin"). Omit to translate every locale-backed layer in one call — the recommended default for layered projects, which returns a result per layer plus an aggregated summary.
referenceLocalestringnoLocale code used as the translation source (e.g., "en", "en-US"). Defaults to the project default locale.
targetLocalesstring[]noLocale codes to translate into (e.g., "de", "fr", "sv"). Defaults to all locales except the reference.
keysstring[]noDot-path keys to translate (e.g., "auth.login.title", "common.save"). If omitted, translates every missing key in the layer.
batchSizeintegernoMaximum number of keys per provider request. Default: 50. A lower value reduces per-batch risk and increases round trips.
overwriteStalebooleannoAlso re-translate keys whose target value was written from source text that has changed since. Needs the translation memory, which is on unless translationMemory is false in the project config — without it nothing is known to be stale and this changes nothing. Default: false, which reports those keys under "stale" and leaves their values alone.
dryRunbooleannoReturn which keys would be translated without calling the provider or writing files. Default: false.
compactbooleannoReturn a compact summary (totalTranslated, totalFailed, byLocale) instead of full per-locale results. Default: false.
projectDirstringnoAbsolute path to the project root. Defaults to I18N_PROJECT_DIR, then server cwd. Example: "/home/user/my-app".

Result

FieldTypeDescription
resultsRecord<string, object>Full per-locale results. Absent in compact mode, which returns summary.byLocale instead.
fallbackContextsRecord<string, Record<string, unknown>>Per-locale context to translate inline and persist with write_translations. Present only in agent mode.
summaryobjectWhat the run did across every locale of the layer.
layersRecord<string, object>One full result per locale-backed layer.

Behavior Hints

A host reads these to decide whether a call needs your confirmation first.

HintValue
readOnlyHintfalse
destructiveHintfalse
idempotentHinttrue
openWorldHinttrue

Paired CLI Command

The same operation runs from a terminal as the-i18n-cli translate, whose page documents its flags.

Copyright © 2026