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
| Parameter | Type | Required | Description |
|---|---|---|---|
layer | string | yes | Layer name from discover to update (e.g., "root", "app-admin"). |
key | string | yes | Dot-separated key path to translate. Example: "bookingCreator.options.removeSubResource". |
sourceLocale | string | yes | Source locale ref. May be code ("en-us"), language ("en-US"), or file ("en-US.json"). |
sourceValue | string | no | Optional source value. If provided, source locale is added/updated before translating. If omitted, existing source value is read. |
targetLocales | "all" | string[] | no | Target locales to translate into. Use "all" or omit for all locales except source. |
overwrite | boolean | no | When true, overwrite existing target translations. When false, only fill missing targets. Default: true. |
dryRun | boolean | no | When true, previews source/target locales without writing files or calling the translation backend. |
includePreview | boolean | no | When true, include translated values in output. Default false to keep responses compact. |
projectDir | string | no | Absolute 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.
| Hint | Value |
|---|---|
readOnlyHint | false |
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.