Skip to main content
Glama
fabkho
by fabkho

Write Translations

write_translations

Write translation key-value pairs to a locale layer in add, update, or upsert modes, with a dry-run preview.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoWrite mode. "upsert": add-or-update (never fails). "add": only new keys. "update": only existing keys. Default: "upsert".
layerYesLayer name (e.g., "root", "app-admin"). Discover layers via the discover tool.
dryRunNoWhen true, returns a preview of what would be written without writing any files. Default: false.
projectDirNoAbsolute path to the Nuxt project root. Defaults to I18N_PROJECT_DIR, then server cwd. Example: "/home/user/my-app".
translationsYesMap 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" } }
Behavior4/5

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

With no annotations, the description carries the burden and does well: it discloses mode behaviors (skip existing/missing keys), default upsert, alphabetical key insertion, and dryRun's no-write preview. It does not explicitly mention file mutation effects or permissions, but the core behavioral traits are surfaced.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is three purposeful sentences: purpose, mode/behavior, and usage note. Front-loaded, no fluff, every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The complexity is moderate (5 params, nested object, no output schema), and the description covers the essential write semantics, mode differences, insertion order, and dryRun. Could add a note on whether existing layer files are merged or overwritten for transparency, but overall adequately contextual.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with thorough descriptions for all 5 parameters, so the bar for the description is low. The description adds a few extras (alphabetical order, dryRun preview, default mode context) but these are marginal and largely restate or slightly expand what the schema already offers.

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?

The description uses a specific verb ('write') with a clear resource ('translation key-value pairs to a layer') and enumerates three modes that expand the scope. It clearly distinguishes itself from siblings by covering the primary bulk-write operation, unlike read, remove, rename, or translate tools.

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?

The description gives explicit when-to-use guidance for each mode (upsert/add/update), calls out the default most common mode, and recommends dryRun for preview. However, it does not explicitly contrast with sibling tools like translate_missing or get_translations, so alternative exclusion is absent.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/fabkho/the-i18n-kit'

If you have feedback or need assistance with the MCP directory API, please join our Discord server