MCP Tools

find_duplicate_keys

Find translation keys defined in BOTH a shared layer and an app layer that consumes it. For example the same key in a monorepo root layer and in app-shop. At runtime the app layer's value shadows the shared one, so a collision with divergent values is the dangerous case: the shared value silently never shows. Compares one reference locale and reports each collision with both values and a divergent flag. Fix by deleting one side, never by moving.

Parameters

ParameterTypeRequiredDescription
localestringnoLocale code to compare values in (e.g., "de", "en-US"). Defaults to the project default locale.
byValuebooleannoAlso group different keys carrying the same value — e.g. common.actions.save and calendar.views.save both "Speichern". Each group says what to do about it: "reuse" (a shared layer already has it — delete the app copies and repoint the call sites), "promote" (move one to a shared layer) or "consolidate" (duplication inside one layer). Default: false.
minValueLengthintegernoShortest value worth grouping when byValue is set. Default: 4 — below that, values like "OK" repeat across unrelated namespaces legitimately.
outputFilestringnoAbsolute path to write the full JSON output to. Only a compact summary is returned to the caller, which is what you want for a result too large to read in one piece. Example: ".i18n-reports/duplicate-keys.json"
projectDirstringnoAbsolute path to the project root. Defaults to I18N_PROJECT_DIR, then server cwd. Example: "/home/user/my-app".

Result

FieldTypeDescription
collisionsobject[]Keys defined in both a shared layer and a layer that consumes it.
valueDuplicatesobject[]Different keys carrying the same value. Present only when byValue was passed.
guidancestringHow to act on the findings, in one paragraph.
summaryobjectWhat the scan compared and what it found. This is what comes back when the full result is diverted to a file.
reportFilestringAbsolute path the full JSON result was written to. Read the file for the findings; the summary below is all that came back.

Behavior Hints

A host reads these to decide whether a call needs your confirmation first.

HintValue
readOnlyHinttrue
openWorldHintfalse

Paired CLI Command

The same operation runs from a terminal as the-i18n-cli find-duplicates, whose page documents its flags.

Copyright © 2026