Skip to main content
Glama

translate_page

Translate a page's locale files into multiple languages by reading the English source and generating translations for Chinese, Japanese, French, and German.

Instructions

Translate a specific page's locale files. Use this when user says 'i18n翻译{pageName}页面'. Reads from {basePath}/{pageName}/en-US/ and creates translations in zh-CN, ja-JP, fr-FR, de-DE directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoQwen model to use (default: qwen-turbo)qwen-turbo
apiKeyNoDashScope API key (optional, can use env var DASHSCOPE_API_KEY)
basePathYesBase path to locale directory (e.g., '/packages/web/src/locale')
pageNameYesName of the page to translate (e.g., 'mockupA')
incrementalNoOnly translate new/modified keys (default: true)
sourceLocaleNoSource locale code (default: en-US)en-US
targetLocalesNoTarget locale codes (default: zh-CN, ja-JP, fr-FR, de-DE)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior3/5

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

With no annotations provided, the description must carry the behavioral burden. It discloses the main I/O behavior: reads from '/en-US/' and creates translations in target locale directories. However, it does not mention that the tool invokes an LLM (despite model/apiKey parameters), whether it overwrites existing files, or if it requires network/API access. These are meaningful behavioral 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 two sentences with no filler. The primary purpose and trigger are front-loaded in the first sentence, and the path structure is conveyed compactly in the second. Every clause contributes useful information.

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?

The tool has 7 parameters and no output schema, so the description needs to provide enough context for correct invocation. It covers the trigger, paths, and target locales well, but it omits any hint about return values or what success looks like, and it does not mention the model/API dependency implied by the schema. With high schema coverage the gaps are moderate, earning a middling score.

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?

Schema description coverage is 100%, so the baseline is 3. The description adds semantic value by showing the relationship between basePath and pageName through the path template '{basePath}/{pageName}/en-US/' and by listing the exact target locale directories, which reinforces the meaning of targetLocales. This goes slightly beyond merely repeating schema descriptions.

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 opens with a specific verb and resource: 'Translate a specific page's locale files.' It clearly distinguishes from siblings by focusing on translation of a single page's locale files, while check-i18n suggests verification and show_glossary suggests display. The trigger phrase 'i18n翻译{pageName}页面' further anchors the exact use case.

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 explicitly states when to use this tool: 'Use this when user says i18n翻译{pageName}页面'. This is a clear triggering condition. It does not explicitly name alternatives or exclusion cases, but the trigger phrase alone provides sufficient guidance for an agent to select it over the sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools