Skip to main content
Glama

localizationFindMissing

Identify translation keys that exist but lack specific language translations in localization files to maintain multilingual consistency.

Instructions

查找有Key值但缺少特定語言翻譯的項目

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYes
languageYes
limitNo

Implementation Reference

  • Core implementation of findMissingTranslations: loads CSV data via cache, filters entries that have a Key but empty/missing value in the specified language, applies limit, returns SearchResult with total and limited entries.
    static async findMissingTranslations(filePath: string, language: string, limit: number = 50): Promise<SearchResult> {
      try {
        if (!language) {
          throw new Error('必須指定要檢查的語言');
        }
    
        const records = await this.getCSVData(filePath);
        
        // 尋找指定語言翻譯為空的項目
        const missingEntries = records.filter(entry => {
          // 確保有Key且該語言的翻譯為空
          return entry.Key && 
                 (entry[language] === undefined || 
                  entry[language] === null || 
                  entry[language].trim() === '');
        });
    
        // 限制返回數量
        const limitedResults = missingEntries.slice(0, limit);
    
        return {
          totalResults: missingEntries.length,
          entries: limitedResults
        };
      } catch (error) {
        console.error(`搜尋缺少翻譯的項目失敗: ${error instanceof Error ? error.message : '未知錯誤'}`);
        throw error;
      }
  • main.ts:434-452 (registration)
    Registers the 'localizationFindMissing' tool on the MCP server, defines input schema (filePath, language, optional limit), provides inline handler that calls LocalizationTool.findMissingTranslations and formats JSON response.
    server.tool("localizationFindMissing",
        "查找有Key值但缺少特定語言翻譯的項目",
        {
            filePath: z.string(),
            language: z.string(),
            limit: z.number().optional()
        },
        async ({ filePath, language, limit = 50 }) => {
            try {
                const results = await LocalizationTool.findMissingTranslations(filePath, language, limit);
                return {
                    content: [{ type: "text", text: JSON.stringify(results, null, 2) }]
                };
            } catch (error) {
                return {
                    content: [{ type: "text", text: `搜尋缺少翻譯項目失敗: ${error instanceof Error ? error.message : "未知錯誤"}` }]
                };
            }
        }
  • Zod input schema for the tool: filePath (string), language (string), limit (number, optional).
    {
        filePath: z.string(),
        language: z.string(),
        limit: z.number().optional()
    },
  • TypeScript interface defining structure of localization entries (CSV rows): Key and language fields.
    export interface LocalizationEntry {
      Key: string;
      'zh-TW': string;
      'zh-CN': string;
      en: string;
      [key: string]: string; // 其他可能的語言欄位
    }
  • Output interface SearchResult used by findMissingTranslations: totalResults (number) and entries array.
    export interface SearchResult {
      totalResults: number;
      entries: LocalizationEntry[];
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While it indicates this is a 'find' operation (likely read-only), it doesn't describe what the tool actually returns (e.g., list of keys, counts, file locations), whether it has side effects, performance characteristics, or error conditions. For a tool with 3 parameters and no annotation coverage, this is insufficient behavioral context.

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

Conciseness5/5

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

The description is extremely concise - a single Chinese sentence that directly states the tool's core function. There's zero wasted language or unnecessary elaboration. It's front-loaded with the essential purpose without any fluff.

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

Completeness2/5

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

Given the tool has 3 parameters with 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns, how parameters interact, or provide any context about the localization system it operates on. For a tool that presumably scans files for missing translations, more context about expected formats, return values, and usage patterns would be needed.

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

Parameters2/5

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

Schema description coverage is 0%, meaning none of the 3 parameters (filePath, language, limit) have descriptions in the schema. The tool description doesn't mention any parameters at all, failing to compensate for the complete lack of schema documentation. Users must guess what filePath refers to, what language format is expected, and what limit controls.

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

Purpose4/5

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

The description clearly states the tool's purpose: '查找有Key值但缺少特定語言翻譯的項目' (Find items that have key values but are missing specific language translations). This specifies the verb (find), resource (localization items), and scope (missing translations). However, it doesn't explicitly differentiate from sibling tools like localizationSearch or localizationGetByKey, which prevents a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. There are multiple sibling localization tools (localizationSearch, localizationGetByKey, localizationFindLongValues, etc.), but the description doesn't indicate when this specific 'find missing' functionality is appropriate versus other search or retrieval operations. No prerequisites or exclusions are mentioned.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/GonTwVn/GonMCPtool'

If you have feedback or need assistance with the MCP directory API, please join our Discord server