MCP Tools
find_orphan_keys
Find translation keys that exist in locale JSON files but are not referenced in any Vue/TS source code. Scans a specific layer or all layers. Reports keys that can potentially be removed. Also detects dynamic key patterns and uncertain matches. Scope-aware: each layer is checked only against code of the apps that consume it (summary.scanScope shows each layer's effective scope); keys referenced only from non-consuming apps are reported separately as misplacedUsages, not orphans.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
layer | string | no | Layer name to check for orphan keys (e.g., "root", "app-admin"). If omitted, checks all layers. Call discover to see available layers. |
locale | string | no | Locale code to read translation keys from (e.g., "en", "en-US"). Defaults to the project default locale. |
scanDirs | string[] | no | Absolute paths to directories to scan for source code usage. Overrides scope-aware scanning: all layers are checked globally against these dirs. Example: "/home/user/my-app/apps/admin". |
excludeDirs | string[] | no | Directory names to skip when scanning source files. Example: "storybook", "tests", "node_modules". |
projectDir | string | no | Absolute path to the Nuxt project root. Defaults to I18N_PROJECT_DIR, then server cwd. Example: "/home/user/my-app". |
outputFile | string | no | Absolute path to write full JSON output. Returns only a compact summary to the caller — use this for large outputs to avoid flooding the conversation context. Example: "/tmp/orphan-keys.json" |
Paired CLI Command
The same operation runs from a terminal as the-i18n-cli remove-orphans, whose page documents its flags. Both paths call the same @the-i18n-kit/cli functions, so the result is the same.
Every tool is advertised by the-i18n-mcp and listed on the MCP tools overview.