MCP Tools

write_translations

Write translation key-value pairs to a layer. Mode "upsert" adds new keys and updates existing ones (default, most common). Mode "add" only creates new keys, skipping existing ones. Mode "update" only modifies existing keys, skipping missing ones. Keys are inserted in alphabetical order. Use dryRun to preview without writing.

Parameters

ParameterTypeRequiredDescription
layerstringyesLayer name (e.g., "root", "app-admin"). Discover layers via the discover tool.
translationsRecord<string, Record<string, string>>yesMap of dot-path keys to locale-value pairs. IMPORTANT: values must be locale maps, NOT plain strings. Locale refs may be code ("en-us"), language ("en-US"), or file ("en-US.json"). Wrong: { "auth.failed": "Login failed" }. Correct: { "auth.failed": { "en-US": "Login failed", "de-DE": "Anmeldung fehlgeschlagen" } }
mode"add" | "update" | "upsert"noWrite mode. "upsert": add-or-update (never fails). "add": only new keys. "update": only existing keys. Default: "upsert".
dryRunbooleannoWhen true, returns a preview of what would be written without writing any files. Default: false.
projectDirstringnoAbsolute path to the Nuxt project root. Defaults to I18N_PROJECT_DIR, then server cwd. Example: "/home/user/my-app".

Paired CLI Command

The same operation runs from a terminal as the-i18n-cli write, 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