Skip to main content
Glama

Interface Translation Add

interface_translation_add

Add a Drupal interface translation for a source string and langcode, creating the source string if missing and clearing the locale cache so new text appears immediately.

Instructions

Add an interface translation for one source string.

Written through Locale's own string storage -- createString() / createTranslation() plus save() -- which is what locale:import does with a .po file, one entry at a time. There is no locale:translate:* command to run instead.

If the source string is not one Drupal has already collected, it is created too and the reply says so: a translation nobody will ever look up is worth knowing about. The locale lookup cache is invalidated, so the new text is visible without a cache rebuild.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYes
contextNo
langcodeYes
translationYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it discloses the write path (createString/createTranslation/save), that a missing source string is auto-created and reported in the reply, and that the locale lookup cache is invalidated so no cache rebuild is needed. It stops short of stating auth/permission requirements.

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?

Front-loads the verb+resource and keeps to three short paragraphs. The middle paragraph on internal Locale storage is slightly implementation-heavy, but each sentence still earns its place by explaining routing and side effects.

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?

An output schema exists, so return values needn't be described, and the description still flags the auto-created-source case. The main gap is parameter-level detail (langcode/context formatting), which is missing across the definition.

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

Parameters2/5

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

Schema coverage is 0% for four parameters, so the description must compensate, but it only gestures at 'source string' and 'translation'. The 'context' and 'langcode' parameters are never explained or exemplified, leaving half the inputs undocumented in both schema and prose.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource with scope: 'Add an interface translation for one source string.' The 'interface' qualifier separates it conceptually from content/config translation, but it never names the ambiguous siblings (translation_add, config_translation_add) directly, so sibling disambiguation is left partly to inference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the interface-translation domain, and it rules out a non-existent 'locale:translate:*' route, which is mild routing help. However, it never states when to prefer this over the closely named siblings translation_add, translation_update, or config_translation_add, so an agent still has to infer the boundary.

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

Deploy Server

Other Tools