Skip to main content
Glama

Write Translations

write_translations

Write translation key-value pairs to a specified layer. Supports upsert, add, or update modes, and dry-run for 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
layerYesLayer name (e.g., "root", "app-admin"). Discover layers via the discover tool.
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" } }
modeNoWrite mode. "upsert": add-or-update (never fails). "add": only new keys. "update": only existing keys. Default: "upsert".
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 server cwd. Example: "/home/user/my-app".
Behavior4/5

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

With no annotations, the description bears full responsibility. It discloses key behaviors: keys are inserted in alphabetical order, dryRun previews without writing, and modes' effects. Missing details on error handling or auth, but core behavior is well-covered.

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

Conciseness4/5

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

The description is well-structured, front-loading the main action and using multiple sentences for clarity. While each sentence adds value, it could be slightly more concise without losing information.

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?

Given the tool's complexity (5 params, nested object) and lack of annotations or output schema, the description is relatively complete. It explains modes, key order, dryRun, and provides formatting examples, but could add more on expected output or error cases.

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

Parameters5/5

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

Although schema coverage is 100%, the description adds significant value beyond the schema: it explains the translations parameter's correct format with examples of wrong vs correct usage, and clarifies that dryRun previews without writing. This greatly aids correct invocation.

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 clearly states the tool writes translation key-value pairs to a layer, with a specific verb and resource. It distinguishes from siblings like get_translations and remove_translations by focusing on writing.

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 provides clear guidance on the three modes (upsert, add, update) and dryRun usage, which helps the agent choose the right mode. However, it does not explicitly mention when not to use this tool or compare it to alternative tools like translate_key.

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