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
| Parameter | Type | Required | Description |
|---|---|---|---|
locale | string | no | Locale code to compare values in (e.g., "de", "en-US"). Defaults to the project default locale. |
byValue | boolean | no | Also 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. |
minValueLength | integer | no | Shortest value worth grouping when byValue is set. Default: 4 — below that, values like "OK" repeat across unrelated namespaces legitimately. |
outputFile | string | no | Absolute 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" |
projectDir | string | no | Absolute path to the project root. Defaults to I18N_PROJECT_DIR, then server cwd. Example: "/home/user/my-app". |
Result
| Field | Type | Description |
|---|---|---|
collisions | object[] | Keys defined in both a shared layer and a layer that consumes it. |
valueDuplicates | object[] | Different keys carrying the same value. Present only when byValue was passed. |
guidance | string | How to act on the findings, in one paragraph. |
summary | object | What the scan compared and what it found. This is what comes back when the full result is diverted to a file. |
reportFile | string | Absolute 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.
| Hint | Value |
|---|---|
readOnlyHint | true |
openWorldHint | false |
Paired CLI Command
The same operation runs from a terminal as the-i18n-cli find-duplicates, whose page documents its flags.