MCP Tools

remove_orphan_keys

Find orphan keys (not referenced in source code) and remove them from all locale files. Always does a dry run first. Scope-aware like find_orphan_keys: each layer is checked against its consuming apps (summary.scanScope), and keys referenced only from non-consuming apps are reported as misplacedUsages and never removed.

Parameters

ParameterTypeRequiredDescription
layerstringnoLayer name to clean up (e.g., "root", "app-admin"). If omitted, cleans all layers. Call discover to discover available layers.
localestringnoLocale code to read translation keys from for orphan detection (e.g., "en", "en-US"). Defaults to the project default locale.
scanDirsstring[]noAbsolute 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".
excludeDirsstring[]noDirectory names to skip when scanning source files. Example: "storybook", "tests", "node_modules".
dryRunbooleannoWhen true (default), only reports what would be removed without deleting anything. Set to false to permanently delete orphan keys.
projectDirstringnoAbsolute path to the Nuxt project root. Defaults to I18N_PROJECT_DIR, then server cwd. Example: "/home/user/my-app".
outputFilestringnoAbsolute 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/cleanup-unused.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.

Copyright © 2026