Skip to main content
Glama
iamnotagentleman

Localizable XStrings MCP Server

get_base_strings_tool

Extract base language strings from Xcode String Catalog (.xcstrings) files to support iOS/macOS localization workflows and translation processes.

Instructions

MCP tool to get base language strings from xcstrings file.

Args:
    file_path (str): Path to the .xcstrings file

Returns:
    str: Base language strings or error message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes

Implementation Reference

  • The main handler function for the 'get_base_strings_tool' tool. It is decorated with @mcp.tool() for registration and implements the logic to validate the xcstrings file, extract base language strings using get_base_language_strings, and return them as a formatted string or an error message.
    def get_base_strings_tool(file_path: str) -> str:
        """
        MCP tool to get base language strings from xcstrings file.
    
        Args:
            file_path (str): Path to the .xcstrings file
    
        Returns:
            str: Base language strings or error message
        """
        try:
            if not validate_xcstrings_file(file_path):
                return f"Error: Invalid file path or not an .xcstrings file: {file_path}"
    
            keys = get_base_language_strings(file_path)
    
            return f"Base language keys ({len(keys)} total):\n" + "\n".join(keys)
        except Exception as e:
            return format_error_message(e, "Failed to get base language strings")

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