find_undefined_keys
The inverse of find_orphan_keys: find keys referenced in source code but defined in NO locale file of the using app's consumed layers — the direction that ships raw keys to production. Scope-aware: each scan unit (app) is checked against the layers it consumes (summary.searchedLayersByApp); a key defined only in a layer the using app does not consume is still undefined for that app. Known limitation: extraction is line-based and static — dynamically built keys (template literals, concatenation) cannot be verified and are reported as uncertainKeys, never as hard findings.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
locale | string | no | Reference locale to resolve key definitions in (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: every layer counts as resolvable from 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/undefined-keys.json" |
Paired CLI Command
The same operation runs from a terminal as the-i18n-cli check, 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.