Skip to main content
Glama

get_keys_tool

Extract all localization keys from Xcode String Catalog (.xcstrings) files to support iOS/macOS project translation workflows and localization management.

Instructions

MCP tool to get all localization keys from xcstrings file. Args: file_path (str): Path to the .xcstrings file Returns: str: List of all keys or error message

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes

Implementation Reference

  • Handler function for the 'get_keys_tool' MCP tool. It validates the xcstrings file, extracts base keys using extract_base_keys, and returns a formatted list of keys or an error message. Registered via @mcp.tool() decorator.
    @mcp.tool() def get_keys_tool(file_path: str) -> str: """ MCP tool to get all localization keys from xcstrings file. Args: file_path (str): Path to the .xcstrings file Returns: str: List of all 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}" keys = extract_base_keys(file_path) return f"Found {len(keys)} keys:\n" + "\n".join(keys) except Exception as e: return format_error_message(e, "Failed to get keys")

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