Skip to main content
Glama
GalvinGao

SimpleLocalize MCP Server

by GalvinGao

get_missing_translations

Identify translation keys with missing language translations in your SimpleLocalize project to prioritize localization work.

Instructions

Get a list of translation keys that have missing translations.

This endpoint returns translation keys along with their existing translations, focusing on keys that are missing translations in one or more languages. To identify missing translations, the function compares each key against all languages that have at least one translation in the project.

Returns: List of dictionaries containing: - key (str): Translation key - namespace (str): Namespace for the key (if applicable) - description (str): Description for translators (if applicable) - translations (List[dict]): List of existing translations with fields: - language (str): Language code - text (str): Translation text

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • main.py:314-400 (handler)
    Handler function for the 'get_missing_translations' tool. It fetches all translations from the SimpleLocalize API, identifies keys missing translations in some languages, and returns a list of those keys with their existing translations.
    @mcp.tool()
    async def get_missing_translations() -> List[dict]:
        """Get a list of translation keys that have missing translations.
        
        This endpoint returns translation keys along with their existing translations,
        focusing on keys that are missing translations in one or more languages.
        To identify missing translations, the function compares each key against all
        languages that have at least one translation in the project.
        
        Returns:
            List of dictionaries containing:
                - key (str): Translation key
                - namespace (str): Namespace for the key (if applicable)
                - description (str): Description for translators (if applicable)
                - translations (List[dict]): List of existing translations with fields:
                    - language (str): Language code
                    - text (str): Translation text
        """
        try:
            # Get all translation keys with their translations
            result = await make_simplelocalize_request(
                "GET",
                "/api/v2/translations"
            )
            
            data = result.get("data", [])
            
            # First pass: collect all languages used in the project
            all_languages = set()
            keys_map = {}
            
            for item in data:
                key = item.get("key", "")
                namespace = item.get("namespace", "")
                description = item.get("description", "")
                language = item.get("language", "")
                text = item.get("text", "")
                
                if language:
                    all_languages.add(language)
                
                # Create a unique identifier for the key (including namespace)
                key_id = f"{namespace}:{key}" if namespace else key
                
                if key_id not in keys_map:
                    keys_map[key_id] = {
                        "key": key,
                        "namespace": namespace,
                        "description": description,
                        "translations": [],
                        "languages_with_translations": set()
                    }
                
                # Add translation if text exists
                if text and language:
                    keys_map[key_id]["translations"].append({
                        "language": language,
                        "text": text
                    })
                    keys_map[key_id]["languages_with_translations"].add(language)
            
            # Second pass: filter for keys that have missing translations
            missing_translations = []
            
            for key_data in keys_map.values():
                # Check if this key is missing translations in any language
                missing_languages = all_languages - key_data["languages_with_translations"]
                
                # Only include keys that have missing translations
                if missing_languages:
                    # Remove the helper set before returning
                    key_result = {
                        "key": key_data["key"],
                        "namespace": key_data["namespace"],
                        "description": key_data["description"],
                        "translations": key_data["translations"]
                    }
                    missing_translations.append(key_result)
            
            if len(missing_translations) == 0:
                return "No missing translations found"
            
            return missing_translations
            
        except SimpleLocalizeError as e:
            return [{"error": str(e)}]
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior: it returns a list of dictionaries with specific fields (key, namespace, description, translations) and explains how missing translations are identified (by comparing keys against languages with at least one translation). It does not cover aspects like rate limits, authentication needs, or error handling, but provides sufficient context for basic use.

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 well-structured and front-loaded: the first sentence clearly states the purpose, followed by details on functionality and return format. Every sentence adds value—explaining the missing translation logic and output structure—with no redundant or wasted information.

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?

Given the tool's complexity (moderate, involving data retrieval and comparison), no annotations, no output schema, and 0 parameters, the description is largely complete. It explains what the tool does, how it identifies missing translations, and details the return structure. However, it lacks information on error cases or performance considerations, which could be helpful for full contextual understanding.

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

Parameters4/5

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

The input schema has 0 parameters with 100% coverage, so the schema fully documents the lack of parameters. The description does not add parameter information, which is unnecessary here. Since there are no parameters, the baseline is 4, as the description need not compensate for any gaps.

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?

The description clearly states the tool's purpose: 'Get a list of translation keys that have missing translations.' It specifies the verb ('Get'), resource ('translation keys'), and scope ('missing translations'), distinguishing it from siblings like 'get_translations_for_keys' (which retrieves translations for given keys) and 'update_translations' (which modifies translations).

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

Usage Guidelines3/5

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

The description implies usage by explaining the tool's focus on 'keys that are missing translations in one or more languages' and comparing 'against all languages that have at least one translation in the project,' suggesting it's for identifying gaps in translation coverage. However, it does not explicitly state when to use this tool versus alternatives like 'get_translations_for_keys' or provide exclusions, leaving some ambiguity.

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/GalvinGao/mcp-simplelocalize'

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