Skip to main content
Glama
iamnotagentleman

Localizable XStrings MCP Server

apply_missing_tool

Apply translations to missing keys in iOS/macOS string catalogs for a target language, updating only untranslated entries in .xcstrings files.

Instructions

MCP tool to apply only missing translations for a target language in xcstrings file.
Only translates keys that don't already have translations in the target language.

Args:
    file_path (str): Path to the .xcstrings file
    target_language (str): Target language code
    app_description (str): Optional description of the app for better translation context

Returns:
    str: Application result with newly translated keys or error message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
target_languageYes
app_descriptionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The complete handler function for the MCP tool 'apply_missing_tool', including the @mcp.tool() decorator which handles registration. It performs input validation, invokes the core translation logic via apply_missing_translations, formats results including backups and skipped keys, and handles errors.
    @mcp.tool()
    def apply_missing_tool(file_path: str, target_language: str, app_description: str = "") -> str:
        """
        MCP tool to apply only missing translations for a target language in xcstrings file.
        Only translates keys that don't already have translations in the target language.
    
        Args:
            file_path (str): Path to the .xcstrings file
            target_language (str): Target language code
            app_description (str): Optional description of the app for better translation context
    
        Returns:
            str: Application result with newly translated keys or error message
        """
        try:
            if not validate_xcstrings_file(file_path):
                return f"Error: Invalid file path or not an .xcstrings file: {file_path}"
    
            if not validate_language_code(target_language):
                return f"Error: Invalid language code: {target_language}"
    
            # Apply only missing translations
            app_desc = app_description if app_description else None
            applied_translations, backup_path, summary, skipped_keys = apply_missing_translations(file_path, target_language, app_description=app_desc)
            
            result = [
                f"Summary: {summary}",
            ]
            
            if backup_path:
                result.append(f"Backup created: {backup_path}")
            
            if applied_translations:
                result.append(f"\nNew translations added ({len(applied_translations)}):")
                for key, value in applied_translations.items():
                    result.append(f"{key}: {value}")
            
            if skipped_keys:
                result.append(f"\nSkipped strings ({len(skipped_keys)}):")
                for key, reason in skipped_keys.items():
                    result.append(f"{key}: {reason}")
            
            return "\n".join(result)
    
        except Exception as e:
            return format_error_message(e, "Failed to apply missing translations")
Behavior3/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 describes the tool's selective translation behavior and mentions optional context for better translations, but doesn't cover important aspects like whether this is a read-only or mutating operation, what permissions are needed, error handling specifics, or rate limits. The description adds some value but leaves gaps in behavioral understanding.

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 efficiently structured with a clear purpose statement followed by parameter explanations and return value information. Every sentence earns its place, and the information is front-loaded with the core functionality stated first. No wasted words or redundant 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 moderate complexity (3 parameters, mutation operation implied), no annotations, and the presence of an output schema, the description does well but has some gaps. It explains parameters and the selective translation behavior, and the output schema handles return values. However, for a tool that likely modifies files, more behavioral context about safety, permissions, or error conditions would improve completeness.

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?

With 0% schema description coverage, the description must compensate for the lack of parameter documentation in the schema. It successfully explains all three parameters: file_path (path to .xcstrings file), target_language (language code), and app_description (optional context). The description adds meaningful semantics beyond what the bare schema provides, though it doesn't specify format requirements (e.g., language code format).

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 specific action ('apply only missing translations'), resource ('.xcstrings file'), and scope ('for a target language'). It distinguishes itself from siblings by specifying it only translates keys without existing translations, unlike 'apply_tool' or 'translate_tool' which might handle all translations.

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?

The description provides clear context about when to use this tool ('Only translates keys that don't already have translations in the target language'), which helps differentiate it from other translation-related tools. However, it doesn't explicitly state when NOT to use it or name specific alternatives among the sibling tools.

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/iamnotagentleman/localizable-xcstrings-mcp'

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