Skip to main content
Glama
fabkho
by fabkho

Find Orphan Translation Keys

find_orphan_keys
DestructiveIdempotent

Report translation keys no source code references, scanning one layer or all. Detects dynamic key patterns and uncertain matches; optionally deletes orphans from locale files.

Instructions

Report translation keys that no source code references. Nothing is deleted unless remove is set. Scans a specific layer or all layers, and also detects dynamic key patterns and uncertain matches. Scope-aware: each layer is checked only against the code of the apps that consume it (summary.scanScope shows each layer's effective scope), and keys referenced only from non-consuming apps are reported separately as misplacedUsages rather than as orphans. With remove the orphan keys are deleted from every locale file of their layer — uncertain keys and misplaced usages are never deleted, in any mode.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
layerNoLayer name to scope this to (e.g., "root", "app-admin"). If omitted, every layer is included. Call discover to list the layers.
localeNoLocale code to read the translation keys from (e.g., "en", "en-US"). Defaults to the project default locale.
removeNoPermanently delete the orphan keys from every locale file of their layer. Default: false, which only reports them — run without it first and read the findings. Uncertain keys and misplaced usages are never deleted.
scanDirsNoAbsolute paths of the directories to scan for source usage. Overrides scope-aware scanning: every layer is then checked against these directories alone. Example: ["/home/user/my-app/apps/admin"].
outputFileNoAbsolute 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/orphan-keys.json"
projectDirNoAbsolute path to the project root. Defaults to I18N_PROJECT_DIR, then server cwd. Example: "/home/user/my-app".
excludeDirsNoDirectory names to skip when scanning source files. Example: ["storybook", "__tests__", "node_modules"].

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changedv1.0.6
    • changedInput schema / properties / layer / description
      Previous value: -"Layer name to check for orphan keys (e.g., \"root\", \"app-admin\"). If omitted, checks all layers. Call discover to see available layers."New value: +"Layer name to scope this to (e.g., \"root\", \"app-admin\"). If omitted, every layer is included. Call discover to list the layers."
    • changedInput schema / properties / locale / description
      Previous value: -"Locale code to read translation keys from (e.g., \"en\", \"en-US\"). Defaults to the project default locale."New value: +"Locale code to read the translation keys from (e.g., \"en\", \"en-US\"). Defaults to the project default locale."
    • changedInput schema / properties / outputFile / description
      Previous value: -"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\""New value: +"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/orphan-keys.json\""
    • changedInput schema / properties / projectDir / description
      Previous value: -"Absolute path to the Nuxt project root. Defaults to I18N_PROJECT_DIR, then server cwd. Example: \"/home/user/my-app\"."New value: +"Absolute path to the project root. Defaults to I18N_PROJECT_DIR, then server cwd. Example: \"/home/user/my-app\"."
    • addedInput schema / properties / remove
      Added value: +{
      +  "description": "Permanently delete the orphan keys from every locale file of their layer. Default: false, which only reports them — run without it first and read the findings. Uncertain keys and misplaced usages are never deleted.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / scanDirs / description
      Previous value: -"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\"]."New value: +"Absolute paths of the directories to scan for source usage. Overrides scope-aware scanning: every layer is then checked against these directories alone. Example: [\"/home/user/my-app/apps/admin\"]."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "anyOf": [
      +    {
      +      "anyOf": [
      +        {
      +          "additionalProperties": false,
      +          "properties": {
      +            "candidateOnlyKeys": {
      +              "additionalProperties": {
      +                "description": "Dot-path keys of that layer.",
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              },
      +              "description": "Layer → keys kept alive only by the bare-candidate net: a dotted string somewhere shares their name, but nothing a frontend calls a usage references them. Not orphans, but where dead references hide.",
      +              "propertyNames": {
      +                "description": "Layer name.",
      +                "type": "string"
      +              },
      +              "type": "object"
      +            },
      +            "candidateOnlyNote": {
      +              "description": "How to read the candidate-only keys. Present alongside them.",
      +              "type": "string"
      +            },
      +            "declaredNamespaceNote": {
      +              "description": "How to read the declared namespaces. Present alongside them.",
      +              "type": "string"
      +            },
      +            "declaredNamespaces": {
      +              "description": "Every declared namespace with the keys it covers — the keys this scan will not report. Present when the config declares any.",
      +              "items": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "matchedKeys": {
      +                    "description": "Keys of the checked layers this pattern covers. Empty means the declaration is stale.",
      +                    "items": {
      +                      "type": "string"
      +                    },
      +                    "type": "array"
      +                  },
      +                  "pattern": {
      +                    "description": "The declaredNamespaces pattern from the project config, e.g. \"views.defaults.**\".",
      +                    "type": "string"
      +                  },
      +                  "reason": {
      +                    "description": "What keeps these keys alive, as the config declares it.",
      +                    "type": "string"
      +                  }
      +                },
      +                "required": [
      +                  "pattern",
      +                  "reason",
      +                  "matchedKeys"
      +                ],
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            "dynamicKeyWarning": {
      +              "description": "Present when dynamic key expressions were found, which is when the orphan list is a candidate list rather than a verdict.",
      +              "type": "string"
      +            },
      +            "dynamicKeys": {
      +              "description": "Dynamic key expressions found in source, with their call sites.",
      +              "items": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "expression": {
      +                    "description": "The key expression as written in source, e.g. \"`errors.${code}`\".",
      +                    "type": "string"
      +                  },
      +                  "file": {
      +                    "description": "Source file, relative to the project directory. Absent for context-free bare candidates, which have no single call site.",
      +                    "type": "string"
      +                  },
      +                  "line": {
      +                    "description": "1-based line number in that file. Absent with file.",
      +                    "maximum": 9007199254740991,
      +                    "minimum": -9007199254740991,
      +                    "type": "integer"
      +                  }
      +                },
      +                "required": [
      +                  "expression"
      +                ],
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            "linkedNote": {
      +              "description": "Why keys linked with @: from another message's value are not orphans. Present when any is.",
      +              "type": "string"
      +            },
      +            "misplacedUsageNote": {
      +              "description": "What to do about the misplaced usages. Present alongside them.",
      +              "type": "string"
      +            },
      +            "misplacedUsages": {
      +              "description": "Keys referenced only from apps that do not consume the owning layer. Reported instead of being called orphans, and never deleted.",
      +              "items": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "key": {
      +                    "description": "Dot-path key referenced only from outside its layer's consumption scope.",
      +                    "type": "string"
      +                  },
      +                  "layer": {
      +                    "description": "Layer the key is defined in.",
      +                    "type": "string"
      +                  },
      +                  "usingApps": {
      +                    "description": "Scan units (apps or layers) that reference it without consuming that layer.",
      +                    "items": {
      +                      "type": "string"
      +                    },
      +                    "type": "array"
      +                  }
      +                },
      +                "required": [
      +                  "key",
      +                  "layer",
      +                  "usingApps"
      +                ],
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            "orphanKeys": {
      +              "additionalProperties": {
      +                "description": "Dot-path keys of that layer.",
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              },
      +              "description": "Layer → keys no source code of a consuming app references. The only keys remove ever deletes.",
      +              "propertyNames": {
      +                "description": "Layer name.",
      +                "type": "string"
      +              },
      +              "type": "object"
      +            },
      +            "summary": {
      +              "additionalProperties": false,
      +              "description": "What the scan covered and what it found. This is what comes back when the full result is diverted to a file.",
      +              "properties": {
      +                "candidateOnlyCount": {
      +                  "description": "Keys kept alive only by the bare-candidate net.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "declaredCount": {
      +                  "description": "Keys withheld from the orphan list by a declaredNamespaces entry.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "dirsScanned": {
      +                  "description": "Directories the source scan walked.",
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "dynamicMatchedCount": {
      +                  "description": "Keys kept alive by a dynamic key expression rather than a literal call.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "filesDeclined": {
      +                  "description": "Files a syntax frontend declined; pattern matching read them instead.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "filesScanned": {
      +                  "description": "Source files read.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "ignoredCount": {
      +                  "description": "Keys excluded by an orphanScan ignorePattern.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "layersChecked": {
      +                  "description": "Layer names the scan covered.",
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "linkedCount": {
      +                  "description": "Keys withheld because another message's value links to them with @:. Protected in every layer, never deleted.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "locale": {
      +                  "description": "Locale the translation keys were read from.",
      +                  "type": "string"
      +                },
      +                "message": {
      +                  "description": "One sentence stating what the scan found.",
      +                  "type": "string"
      +                },
      +                "misplacedCount": {
      +                  "description": "Keys used only from apps that do not consume their layer. Never deleted.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "orphanCount": {
      +                  "description": "Keys nothing references. The counter the orphan gate reads.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "scanScope": {
      +                  "additionalProperties": {
      +                    "description": "Directories that layer was checked against.",
      +                    "items": {
      +                      "type": "string"
      +                    },
      +                    "type": "array"
      +                  },
      +                  "description": "Each layer's effective scope: the code of the apps that consume it.",
      +                  "propertyNames": {
      +                    "description": "Layer name.",
      +                    "type": "string"
      +                  },
      +                  "type": "object"
      +                },
      +                "totalKeys": {
      +                  "description": "Translation keys of the checked layers.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "uncertainCount": {
      +                  "description": "Keys with ambiguous usage evidence. Never deleted, in any mode.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "usedCount": {
      +                  "description": "Keys with usage evidence in a consuming app.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "totalKeys",
      +                "orphanCount",
      +                "filesScanned"
      +              ],
      +              "type": "object"
      +            },
      +            "uncertainKeys": {
      +              "additionalProperties": {
      +                "description": "Dot-path keys of that layer.",
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              },
      +              "description": "Layer → keys with ambiguous usage evidence. Never deleted, in any mode.",
      +              "propertyNames": {
      +                "description": "Layer name.",
      +                "type": "string"
      +              },
      +              "type": "object"
      +            },
      +            "unresolvedKeyWarnings": {
      +              "description": "Dynamic expressions that could not be resolved to concrete keys, each with an ignore pattern that would cover it.",
      +              "items": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "callee": {
      +                    "description": "The translation function the expression was passed to, e.g. \"t\" or \"$t\".",
      +                    "type": "string"
      +                  },
      +                  "expression": {
      +                    "description": "The dynamic key expression that could not be resolved to concrete keys.",
      +                    "type": "string"
      +                  },
      +                  "file": {
      +                    "description": "Source file, relative to the project directory.",
      +                    "type": "string"
      +                  },
      +                  "line": {
      +                    "description": "1-based line number of the call.",
      +                    "maximum": 9007199254740991,
      +                    "minimum": -9007199254740991,
      +                    "type": "integer"
      +                  },
      +                  "suggestedIgnorePattern": {
      +                    "description": "A key glob for orphanScan.ignorePatterns that would cover this expression, when one can be derived.",
      +                    "type": "string"
      +                  }
      +                },
      +                "required": [
      +                  "expression",
      +                  "file",
      +                  "line",
      +                  "callee"
      +                ],
      +                "type": "object"
      +              },
      +              "type": "array"
      +            }
      +          },
      +          "required": [
      +            "orphanKeys",
      +            "summary"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "additionalProperties": false,
      +          "properties": {
      +            "declaredNamespaceNote": {
      +              "description": "How to read the declared namespaces. Present alongside them.",
      +              "type": "string"
      +            },
      +            "declaredNamespaces": {
      +              "description": "Every declared namespace with the keys it covers — the keys this scan will not report. Present when the config declares any.",
      +              "items": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "matchedKeys": {
      +                    "description": "Keys of the checked layers this pattern covers. Empty means the declaration is stale.",
      +                    "items": {
      +                      "type": "string"
      +                    },
      +                    "type": "array"
      +                  },
      +                  "pattern": {
      +                    "description": "The declaredNamespaces pattern from the project config, e.g. \"views.defaults.**\".",
      +                    "type": "string"
      +                  },
      +                  "reason": {
      +                    "description": "What keeps these keys alive, as the config declares it.",
      +                    "type": "string"
      +                  }
      +                },
      +                "required": [
      +                  "pattern",
      +                  "reason",
      +                  "matchedKeys"
      +                ],
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            "dynamicKeyWarning": {
      +              "description": "Present when dynamic key expressions were found, which is when the orphan list is a candidate list rather than a verdict.",
      +              "type": "string"
      +            },
      +            "dynamicKeys": {
      +              "description": "Dynamic key expressions found in source, with their call sites.",
      +              "items": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "expression": {
      +                    "description": "The key expression as written in source, e.g. \"`errors.${code}`\".",
      +                    "type": "string"
      +                  },
      +                  "file": {
      +                    "description": "Source file, relative to the project directory. Absent for context-free bare candidates, which have no single call site.",
      +                    "type": "string"
      +                  },
      +                  "line": {
      +                    "description": "1-based line number in that file. Absent with file.",
      +                    "maximum": 9007199254740991,
      +                    "minimum": -9007199254740991,
      +                    "type": "integer"
      +                  }
      +                },
      +                "required": [
      +                  "expression"
      +                ],
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            "misplacedUsageNote": {
      +              "description": "What to do about the misplaced usages. Present alongside them.",
      +              "type": "string"
      +            },
      +            "misplacedUsages": {
      +              "description": "Keys referenced only from apps that do not consume the owning layer. Reported instead of being called orphans, and never deleted.",
      +              "items": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "key": {
      +                    "description": "Dot-path key referenced only from outside its layer's consumption scope.",
      +                    "type": "string"
      +                  },
      +                  "layer": {
      +                    "description": "Layer the key is defined in.",
      +                    "type": "string"
      +                  },
      +                  "usingApps": {
      +                    "description": "Scan units (apps or layers) that reference it without consuming that layer.",
      +                    "items": {
      +                      "type": "string"
      +                    },
      +                    "type": "array"
      +                  }
      +                },
      +                "required": [
      +                  "key",
      +                  "layer",
      +                  "usingApps"
      +                ],
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            "orphanKeys": {
      +              "additionalProperties": {
      +                "description": "Dot-path keys of that layer.",
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              },
      +              "description": "Layer → keys that were found unreferenced. Present on a dry run.",
      +              "propertyNames": {
      +                "description": "Layer name.",
      +                "type": "string"
      +              },
      +              "type": "object"
      +            },
      +            "removed": {
      +              "additionalProperties": {
      +                "description": "Dot-path keys of that layer.",
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              },
      +              "description": "Layer → keys deleted from every locale file of that layer.",
      +              "propertyNames": {
      +                "description": "Layer name.",
      +                "type": "string"
      +              },
      +              "type": "object"
      +            },
      +            "summary": {
      +              "additionalProperties": false,
      +              "description": "What the removal covered and what it deleted. This is what comes back when the full result is diverted to a file.",
      +              "properties": {
      +                "declaredCount": {
      +                  "description": "Keys withheld from the orphan list by a declaredNamespaces entry.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "dirsScanned": {
      +                  "description": "Directories the source scan walked.",
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "dryRun": {
      +                  "description": "True when nothing was deleted because a preview was asked for.",
      +                  "type": "boolean"
      +                },
      +                "dynamicMatchedCount": {
      +                  "description": "Keys kept alive by a dynamic key expression rather than a literal call.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "filesScanned": {
      +                  "description": "Source files read.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "filesWritten": {
      +                  "description": "Locale files changed on disk.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "ignoredCount": {
      +                  "description": "Keys excluded by an orphanScan ignorePattern.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "layersChecked": {
      +                  "description": "Layer names the scan covered.",
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "linkedCount": {
      +                  "description": "Keys withheld because another message's value links to them with @:. Protected in every layer, never deleted.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "locale": {
      +                  "description": "Locale the translation keys were read from.",
      +                  "type": "string"
      +                },
      +                "message": {
      +                  "description": "One sentence stating what the scan found.",
      +                  "type": "string"
      +                },
      +                "misplacedCount": {
      +                  "description": "Keys used only from apps that do not consume their layer. Never deleted.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "orphanCount": {
      +                  "description": "Keys nothing references. The counter the orphan gate reads.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "remainingCount": {
      +                  "description": "Keys left in the layer after the removal.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "removedCount": {
      +                  "description": "Keys deleted from their layer.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "scanScope": {
      +                  "additionalProperties": {
      +                    "description": "Directories that layer was checked against.",
      +                    "items": {
      +                      "type": "string"
      +                    },
      +                    "type": "array"
      +                  },
      +                  "description": "Each layer's effective scope: the code of the apps that consume it.",
      +                  "propertyNames": {
      +                    "description": "Layer name.",
      +                    "type": "string"
      +                  },
      +                  "type": "object"
      +                },
      +                "totalKeys": {
      +                  "description": "Translation keys of the checked layers.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "uncertainCount": {
      +                  "description": "Keys with ambiguous usage evidence. Never deleted, in any mode.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "usedCount": {
      +                  "description": "Keys with usage evidence in a consuming app.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "totalKeys"
      +              ],
      +              "type": "object"
      +            },
      +            "uncertainKeys": {
      +              "additionalProperties": {
      +                "description": "Dot-path keys of that layer.",
      +                "items": {
      +                  "type": "string"
      +                },
      +                "type": "array"
      +              },
      +              "description": "Layer → keys with ambiguous usage evidence. Never deleted, in any mode.",
      +              "propertyNames": {
      +                "description": "Layer name.",
      +                "type": "string"
      +              },
      +              "type": "object"
      +            },
      +            "unresolvedKeyWarnings": {
      +              "description": "Dynamic expressions that could not be resolved to concrete keys, each with an ignore pattern that would cover it.",
      +              "items": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "callee": {
      +                    "description": "The translation function the expression was passed to, e.g. \"t\" or \"$t\".",
      +                    "type": "string"
      +                  },
      +                  "expression": {
      +                    "description": "The dynamic key expression that could not be resolved to concrete keys.",
      +                    "type": "string"
      +                  },
      +                  "file": {
      +                    "description": "Source file, relative to the project directory.",
      +                    "type": "string"
      +                  },
      +                  "line": {
      +                    "description": "1-based line number of the call.",
      +                    "maximum": 9007199254740991,
      +                    "minimum": -9007199254740991,
      +                    "type": "integer"
      +                  },
      +                  "suggestedIgnorePattern": {
      +                    "description": "A key glob for orphanScan.ignorePatterns that would cover this expression, when one can be derived.",
      +                    "type": "string"
      +                  }
      +                },
      +                "required": [
      +                  "expression",
      +                  "file",
      +                  "line",
      +                  "callee"
      +                ],
      +                "type": "object"
      +              },
      +              "type": "array"
      +            }
      +          },
      +          "required": [
      +            "summary"
      +          ],
      +          "type": "object"
      +        },
      +        {
      +          "additionalProperties": false,
      +          "properties": {
      +            "dynamicKeys": {
      +              "description": "Dynamic expressions that could reach the requested keys.",
      +              "items": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "expression": {
      +                    "description": "The key expression as written in source, e.g. \"`errors.${code}`\".",
      +                    "type": "string"
      +                  },
      +                  "file": {
      +                    "description": "Source file, relative to the project directory. Absent for context-free bare candidates, which have no single call site.",
      +                    "type": "string"
      +                  },
      +                  "line": {
      +                    "description": "1-based line number in that file. Absent with file.",
      +                    "maximum": 9007199254740991,
      +                    "minimum": -9007199254740991,
      +                    "type": "integer"
      +                  }
      +                },
      +                "required": [
      +                  "expression"
      +                ],
      +                "type": "object"
      +              },
      +              "type": "array"
      +            },
      +            "notFoundInCode": {
      +              "description": "Requested keys with no reference anywhere in the scanned source.",
      +              "items": {
      +                "type": "string"
      +              },
      +              "type": "array"
      +            },
      +            "summary": {
      +              "additionalProperties": false,
      +              "description": "What the usage scan covered and what it found. This is what comes back when the full result is diverted to a file.",
      +              "properties": {
      +                "dirsScanned": {
      +                  "description": "Directories the scan walked.",
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "filesDeclined": {
      +                  "description": "Files a syntax frontend declined; pattern matching read them instead.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "filesScanned": {
      +                  "description": "Source files read.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "message": {
      +                  "description": "One sentence stating what the scan found.",
      +                  "type": "string"
      +                },
      +                "totalReferences": {
      +                  "description": "Reference sites across every key.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "uniqueKeysFound": {
      +                  "description": "Distinct keys with at least one reference.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "uniqueKeysFound",
      +                "totalReferences",
      +                "filesScanned"
      +              ],
      +              "type": "object"
      +            },
      +            "usages": {
      +              "additionalProperties": {
      +                "description": "Every place that key is referenced.",
      +                "items": {
      +                  "additionalProperties": false,
      +                  "properties": {
      +                    "callee": {
      +                      "description": "The translation function the key was passed to, e.g. \"t\" or \"$t\".",
      +                      "type": "string"
      +                    },
      +                    "file": {
      +                      "description": "Source file the key is referenced from, relative to the project directory.",
      +                      "type": "string"
      +                    },
      +                    "line": {
      +                      "description": "1-based line number of the reference.",
      +                      "maximum": 9007199254740991,
      +                      "minimum": -9007199254740991,
      +                      "type": "integer"
      +                    }
      +                  },
      +                  "required": [
      +                    "file",
      +                    "line",
      +                    "callee"
      +                  ],
      +                  "type": "object"
      +                },
      +                "type": "array"
      +              },
      +              "description": "Key → its references in source. Only keys with at least one reference appear.",
      +              "propertyNames": {
      +                "description": "Dot-path key.",
      +                "type": "string"
      +              },
      +              "type": "object"
      +            }
      +          },
      +          "required": [
      +            "usages",
      +            "summary"
      +          ],
      +          "type": "object"
      +        }
      +      ]
      +    },
      +    {
      +      "additionalProperties": false,
      +      "properties": {
      +        "reportFile": {
      +          "description": "Absolute path the full JSON result was written to. Read the file for the findings; the summary below is all that came back.",
      +          "type": "string"
      +        },
      +        "summary": {
      +          "anyOf": [
      +            {
      +              "additionalProperties": false,
      +              "description": "What the scan covered and what it found. This is what comes back when the full result is diverted to a file.",
      +              "properties": {
      +                "candidateOnlyCount": {
      +                  "description": "Keys kept alive only by the bare-candidate net.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "declaredCount": {
      +                  "description": "Keys withheld from the orphan list by a declaredNamespaces entry.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "dirsScanned": {
      +                  "description": "Directories the source scan walked.",
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "dynamicMatchedCount": {
      +                  "description": "Keys kept alive by a dynamic key expression rather than a literal call.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "filesDeclined": {
      +                  "description": "Files a syntax frontend declined; pattern matching read them instead.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "filesScanned": {
      +                  "description": "Source files read.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "ignoredCount": {
      +                  "description": "Keys excluded by an orphanScan ignorePattern.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "layersChecked": {
      +                  "description": "Layer names the scan covered.",
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "linkedCount": {
      +                  "description": "Keys withheld because another message's value links to them with @:. Protected in every layer, never deleted.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "locale": {
      +                  "description": "Locale the translation keys were read from.",
      +                  "type": "string"
      +                },
      +                "message": {
      +                  "description": "One sentence stating what the scan found.",
      +                  "type": "string"
      +                },
      +                "misplacedCount": {
      +                  "description": "Keys used only from apps that do not consume their layer. Never deleted.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "orphanCount": {
      +                  "description": "Keys nothing references. The counter the orphan gate reads.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "scanScope": {
      +                  "additionalProperties": {
      +                    "description": "Directories that layer was checked against.",
      +                    "items": {
      +                      "type": "string"
      +                    },
      +                    "type": "array"
      +                  },
      +                  "description": "Each layer's effective scope: the code of the apps that consume it.",
      +                  "propertyNames": {
      +                    "description": "Layer name.",
      +                    "type": "string"
      +                  },
      +                  "type": "object"
      +                },
      +                "totalKeys": {
      +                  "description": "Translation keys of the checked layers.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "uncertainCount": {
      +                  "description": "Keys with ambiguous usage evidence. Never deleted, in any mode.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "usedCount": {
      +                  "description": "Keys with usage evidence in a consuming app.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "totalKeys",
      +                "orphanCount",
      +                "filesScanned"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "additionalProperties": false,
      +              "description": "What the removal covered and what it deleted. This is what comes back when the full result is diverted to a file.",
      +              "properties": {
      +                "declaredCount": {
      +                  "description": "Keys withheld from the orphan list by a declaredNamespaces entry.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "dirsScanned": {
      +                  "description": "Directories the source scan walked.",
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "dryRun": {
      +                  "description": "True when nothing was deleted because a preview was asked for.",
      +                  "type": "boolean"
      +                },
      +                "dynamicMatchedCount": {
      +                  "description": "Keys kept alive by a dynamic key expression rather than a literal call.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "filesScanned": {
      +                  "description": "Source files read.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "filesWritten": {
      +                  "description": "Locale files changed on disk.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "ignoredCount": {
      +                  "description": "Keys excluded by an orphanScan ignorePattern.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "layersChecked": {
      +                  "description": "Layer names the scan covered.",
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "linkedCount": {
      +                  "description": "Keys withheld because another message's value links to them with @:. Protected in every layer, never deleted.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "locale": {
      +                  "description": "Locale the translation keys were read from.",
      +                  "type": "string"
      +                },
      +                "message": {
      +                  "description": "One sentence stating what the scan found.",
      +                  "type": "string"
      +                },
      +                "misplacedCount": {
      +                  "description": "Keys used only from apps that do not consume their layer. Never deleted.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "orphanCount": {
      +                  "description": "Keys nothing references. The counter the orphan gate reads.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "remainingCount": {
      +                  "description": "Keys left in the layer after the removal.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "removedCount": {
      +                  "description": "Keys deleted from their layer.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "scanScope": {
      +                  "additionalProperties": {
      +                    "description": "Directories that layer was checked against.",
      +                    "items": {
      +                      "type": "string"
      +                    },
      +                    "type": "array"
      +                  },
      +                  "description": "Each layer's effective scope: the code of the apps that consume it.",
      +                  "propertyNames": {
      +                    "description": "Layer name.",
      +                    "type": "string"
      +                  },
      +                  "type": "object"
      +                },
      +                "totalKeys": {
      +                  "description": "Translation keys of the checked layers.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "uncertainCount": {
      +                  "description": "Keys with ambiguous usage evidence. Never deleted, in any mode.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "usedCount": {
      +                  "description": "Keys with usage evidence in a consuming app.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "totalKeys"
      +              ],
      +              "type": "object"
      +            },
      +            {
      +              "additionalProperties": false,
      +              "description": "What the usage scan covered and what it found. This is what comes back when the full result is diverted to a file.",
      +              "properties": {
      +                "dirsScanned": {
      +                  "description": "Directories the scan walked.",
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "filesDeclined": {
      +                  "description": "Files a syntax frontend declined; pattern matching read them instead.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "filesScanned": {
      +                  "description": "Source files read.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "message": {
      +                  "description": "One sentence stating what the scan found.",
      +                  "type": "string"
      +                },
      +                "totalReferences": {
      +                  "description": "Reference sites across every key.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                },
      +                "uniqueKeysFound": {
      +                  "description": "Distinct keys with at least one reference.",
      +                  "maximum": 9007199254740991,
      +                  "minimum": -9007199254740991,
      +                  "type": "integer"
      +                }
      +              },
      +              "required": [
      +                "uniqueKeysFound",
      +                "totalReferences",
      +                "filesScanned"
      +              ],
      +              "type": "object"
      +            }
      +          ],
      +          "description": "The counts from the full result, so a caller can act on them without reading the file."
      +        }
      +      },
      +      "required": [
      +        "reportFile",
      +        "summary"
      +      ],
      +      "type": "object"
      +    }
      +  ],
      +  "type": "object"
      +}
  2. Changed3 schema fields changedv1.0.3
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedInput schema / properties / projectDir / description
      Previous value: -"Absolute path to the Nuxt project root. Defaults to server cwd. Example: \"/home/user/my-app\"."New value: +"Absolute path to the Nuxt project root. Defaults to I18N_PROJECT_DIR, then server cwd. Example: \"/home/user/my-app\"."
    • changedInput schema / properties / scanDirs / description
      Previous value: -"Absolute paths to directories to scan for source code usage. Defaults to all layer root directories. Example: [\"/home/user/my-app/apps/admin\"]."New value: +"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\"]."
  3. First observedv1.0.0

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations by spelling out blast radius and exceptions: with remove, orphan keys are deleted 'from every locale file of their layer,' while uncertain keys and misplaced usages are 'never deleted, in any mode.' It also explains the scope-aware checking model and the misplacedUsages distinction, which the destructiveHint annotation alone cannot convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four dense sentences, front-loaded with the purpose and the non-destructive default before the destructive mode. Every sentence carries information, though the scope-aware and misplacedUsages explanation is dense enough that it could be trimmed slightly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained, and the description still surfaces summary.scanScope and misplacedUsages as key result concepts. It fully covers the destructive semantics for a 7-parameter tool; only minor items like error behavior are absent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all seven parameters are already documented, making 3 the baseline. The description reinforces behavior around layer scoping ('a specific layer or all layers') and scanDirs overriding scope-aware scanning, but adds little syntax or format detail beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource with a precise filter: 'Report translation keys that no source code references.' The 'orphan' framing implicitly and correctly distinguishes it from the sibling find_undefined_keys (the inverse problem), so an agent can pick between them without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear when-to-use guidance through the remove flag: it explains that the tool only reports by default and that deletion is opt-in, and states the condition under which removal is safe to consider. It does not name an explicit alternative (e.g. remove_translations) or a hard when-not-to-use case, so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.