Skip to main content
Glama
GalvinGao

SimpleLocalize MCP Server

by GalvinGao

publish_translations

Publish translations from the editor to hosting environments or between environments using environment keys like '_latest' or '_production'.

Instructions

Publish translations to a specified environment.

This endpoint publishes translations from the translation editor to hosting environments or from one hosting environment to another. Please note that this endpoint requires authorization and is only available for paid plans.

Common environment keys:

  • "_latest": Publish from Translation Editor

  • "_production": Publish to production environment (from _latest by default)

  • Custom environment key: Publish to custom environment

Args: environment_key: The environment key to publish to (e.g., "_latest", "_production", or custom key)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environment_keyYes

Implementation Reference

  • main.py:145-172 (handler)
    The handler function for the 'publish_translations' tool. It is decorated with @mcp.tool() for registration and implements the logic to publish translations to a SimpleLocalize environment by making a POST API request.
    @mcp.tool()
    async def publish_translations(environment_key: str) -> str:
        """Publish translations to a specified environment.
        
        This endpoint publishes translations from the translation editor to hosting environments
        or from one hosting environment to another. Please note that this endpoint requires
        authorization and is only available for paid plans.
        
        Common environment keys:
        - "_latest": Publish from Translation Editor
        - "_production": Publish to production environment (from _latest by default)
        - Custom environment key: Publish to custom environment
        
        Args:
            environment_key: The environment key to publish to (e.g., "_latest", "_production", or custom key)
        """
        if not environment_key:
            raise ValueError("Environment key is required")
        
        try:
            result = await make_simplelocalize_request(
                "POST",
                f"/api/v2/environments/{environment_key}/publish"
            )
            
            return f"Successfully initiated publishing to environment '{environment_key}'. Status: {result.get('msg', 'OK')}"
        except SimpleLocalizeError as e:
            return str(e)
  • main.py:19-43 (helper)
    Helper function used by publish_translations to make authenticated HTTP requests to the SimpleLocalize API.
    async def make_simplelocalize_request(method: str, endpoint: str, json_data: dict | None = None) -> dict[str, Any]:
        """Make a request to the SimpleLocalize API with proper error handling."""
        headers = {
            "X-SimpleLocalize-Token": SIMPLELOCALIZE_API_KEY,
            "Content-Type": "application/json"
        }
        
        url = f"{SIMPLELOCALIZE_API_BASE}{endpoint}"
        
        async with httpx.AsyncClient() as client:
            try:
                if method.upper() == "POST":
                    response = await client.post(url, headers=headers, json=json_data, timeout=30.0)
                elif method.upper() == "PATCH":
                    response = await client.patch(url, headers=headers, json=json_data, timeout=30.0)
                elif method.upper() == "GET":
                    response = await client.get(url, headers=headers, timeout=30.0)
                else:
                    raise ValueError(f"Unsupported HTTP method: {method}")
                
                response.raise_for_status()
                return response.json()
            except httpx.HTTPError as e:
                raise SimpleLocalizeError(f"SimpleLocalize API error: {str(e)}")
  • main.py:145-145 (registration)
    The @mcp.tool() decorator registers the publish_translations function as an MCP tool.
    @mcp.tool()
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 adds useful context: it requires authorization, is only for paid plans, and describes what gets published (translations from editor or between environments). However, it lacks details on side effects (e.g., overwrites, deployment time), rate limits, or error handling, leaving gaps for a mutation tool.

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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by elaboration on functionality, prerequisites, and parameter details. Every sentence adds value without redundancy, and the structure is clear with bullet points for environment keys.

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

Completeness3/5

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

Given the tool's complexity (a mutation with authorization requirements), no annotations, no output schema, and 1 parameter with 0% schema coverage, the description is moderately complete. It covers purpose, usage context, and parameter semantics well, but lacks details on behavioral outcomes (e.g., what happens after publishing, error responses) and doesn't fully address all contextual needs for safe invocation.

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 description adds significant meaning beyond the input schema, which has 0% description coverage. It explains the 'environment_key' parameter with examples ('_latest', '_production', custom keys) and clarifies their purposes (e.g., '_latest' publishes from Translation Editor). This compensates well for the schema's lack of documentation, though it doesn't cover all possible edge cases or formats.

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: 'Publish translations to a specified environment.' It specifies the verb ('publish') and resource ('translations'), and distinguishes it from siblings like 'create_translation_keys' or 'update_translations' by focusing on deployment rather than creation or editing. However, it doesn't explicitly differentiate from 'get_environment_status' in terms of action vs. query.

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 for when to use this tool: for publishing translations from the editor to environments or between environments. It mentions authorization and paid plan requirements, which are important usage prerequisites. However, it doesn't explicitly state when not to use it or name alternatives like 'update_translations' for editing instead of publishing.

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