MCP Tools

translate_key

Add/update one source translation key and translate it into target locales. Unlike translate_missing, this can overwrite existing stale target translations. Same two modes as translate_missing: provider mode (server env-configured) translates directly; agent mode returns a fallbackContext — translate it inline and persist via write_translations.

Parameters

ParameterTypeRequiredDescription
layerstringyesLayer name from discover to update (e.g., "root", "app-admin").
keystringyesDot-separated key path to translate. Example: "bookingCreator.options.removeSubResource".
sourceLocalestringyesSource locale ref. May be code ("en-us"), language ("en-US"), or file ("en-US.json").
sourceValuestringnoOptional source value. If provided, source locale is added/updated before translating. If omitted, existing source value is read.
targetLocales"all" | string[]noTarget locales to translate into. Use "all" or omit for all locales except source.
overwritebooleannoWhen true, overwrite existing target translations. When false, only fill missing targets. Default: true.
dryRunbooleannoWhen true, previews source/target locales without writing files or calling the translation backend.
includePreviewbooleannoWhen true, include translated values in output. Default false to keep responses compact.
projectDirstringnoAbsolute path to the Nuxt project root. Defaults to I18N_PROJECT_DIR, then server cwd.

Behavior Hints

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

HintValue
readOnlyHintfalse

Paired CLI Command

The same operation runs from a terminal as the-i18n-cli translate-key, whose page documents its flags. Both paths call the same @the-i18n-kit/cli functions, so the result is the same.

Every tool is advertised by the-i18n-mcp and listed on the MCP tools overview.

Copyright © 2026