Skip to main content
Glama
cht-codeini

i18n-file-replace-mcp

by cht-codeini

i18n-file-replace-mcp

English | 中文

MCP (Model Context Protocol) server built on the external API of the i18n resource management platform (https://i18n.codeini.com). Exposes the i18n file replacement capability to MCP clients such as Claude Desktop and Qoder.

Requirements: Node.js >= 20.

Installation

cd i18n-file-replace-mcp
npm install

Stateless: every tool call talks directly to the remote platform API, no data is stored locally.

Related MCP server: i1n

Configuration (MCP clients)

Generic (stdio)

{
  "mcpServers": {
    "i18n-file-replace": {
      "command": "npx",
      "args": ["--yes", "--package", "@codeini/i18n-file-replace-mcp", "i18n-file-replace-mcp"],
      "env": {
        "I18N_API_KEY": "your platform API key"
      }
    }
  }
}
{
  "mcpServers": {
    "i18n-file-replace": {
      "command": "node",
      "args": ["C:/projects/codeini_playground/common/backend/Globalization/General/i18n-file-replace-mcp/src/index.js"],
      "env": {
        "I18N_API_KEY": "your platform API key",
        "I18N_BASE_URL": "https://i18n.codeini.com"
      }
    }
  }
}

Environment variables

Variable

Description

Default

I18N_API_KEY

Platform API key (required, get it from the i18n platform)

none

I18N_BASE_URL

API base URL

https://i18n.codeini.com

I18N_ACCOUNT_ID

Dev-mode tenant override (sends X-Dev-Account-Id; only honored by a Development server)

none

Tools

Tool

Parameters

Returns

replace_file

fileName, content, configJson?, profileName?, resourceSet?, resourceSetByDir?, translateTo? (["en","ja"]), translateProvider?

{ fileName, content, generatedKeys, keyCount, translatedCount? } — with resourceSet + translateTo, each generated key is also machine-translated into the target locales and saved to the same resource set

preview_replace

Same as above (no resourceSet write)

{ fileName, originalContent, content, generatedKeys, keyCount }

list_profiles

none

List of profiles (without configJson)

get_profile

name*

{ id, name, configJson, createdAt, updatedAt }

save_profile

name, configJson

{ message, profile } (create or update)

list_projects

none

List of projects (id, name, locales, resourceSetCount)

list_resource_sets

none

List of resource set names

list_resource_keys

resourceSet*, projectId?

List of { resourceId, hasValue }

download_resources

resourceSet*, format? (.json/.resx/.po/.yaml/.yml), locale?

Single file: { fileName, contentType, content }; ZIP (multi-locale / .resx): { fileName, files: [{ name, content }] }

(* = required; provide at least one of configJson / profileName, configJson takes precedence.)

resourceSetByDir mirrors the CLI's --resource-set-by-dir: when fileName carries a directory prefix (e.g. member/list.vue), the actual resource set becomes <resourceSet>.<first-level dir> (e.g. portal.member).

download_resources returns file contents as text — writing them to disk is up to the caller.

Usage examples

  1. List the available profiles:

    list_profiles
  2. Preview a replacement (no database write):

    preview_replace { fileName: "Home.vue", content: "<template>...</template>", profileName: "vue-home" }
  3. Replace and write the keys into a resource set:

    replace_file { fileName: "Home.vue", content: "<template>...</template>", configJson: "{...}", resourceSet: "home" }
    // also produce English alongside zh in one call:
    replace_file { fileName: "Home.vue", content: "...", profileName: "vue", resourceSet: "home", translateTo: ["en"] }

Debugging

Validate the tools with MCP Inspector:

npx @modelcontextprotocol/inspector node src/index.js

Common errors

Symptom

Fix

Authentication failed (401)

Check I18N_API_KEY in the MCP client config and whether the key is enabled

Cannot connect to ...

Check the network and that I18N_BASE_URL is reachable

Resource not found (404)

The profile name passed to get_profile / preview_replace does not exist

Publishing to npm

A release is cut from a git tag: push vX.Y.Z (the same version as package.json) and the Release workflow runs the tests, then submits this version with npm stage publish.

Staged publishing means the workflow can only queue the package in npm's staging area — nobody installs it from there. Making it live requires a maintainer to approve it on https://www.npmjs.com under the Staged Packages tab (or npm stage approve <stage-id> in the CLI), and that step needs 2FA. CI structurally cannot publish on its own. The workflow reads the NPM_TOKEN repository secret, which must carry @codeini publish rights.

npm test                                       # what CI runs, on your machine
npm run publish:npm                            # stage this working copy by hand (needs NPM_TOKEN)
npm stage list @codeini/i18n-file-replace-mcp  # find the stage-id
npm stage approve <stage-id>                   # make it live (your own npm login + 2FA)

Available Tools

9 tools
download_resources下载资源集翻译A

从 i18n 平台导出指定资源集的翻译内容。单语言返回单个文件内容;多语言或 .resx 返回 ZIP,会自动解包为 { files: [{name, content}] }。返回内容为文本,写盘由调用方决定。需配置环境变量 I18N_API_KEY。

ParametersJSON Schema
NameRequiredDescriptionDefault
formatNo导出格式,默认 .json
localeNo语言代码(如 zh、en);不传时导出全部语言(可能返回 ZIP)
resourceSetYes资源集名称,如 portal.member

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations provided, the description carries full responsibility for behavioral disclosure. It explains the return format based on locale (single file vs. ZIP), the automatic unpacking into a files array, that the returned content is text, that writing to disk is left to the caller (a side-effect disclaimer), and the environment variable requirement. This is comprehensive and beyond what a typical tool description covers.

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 concise, with three sentences that front-load the main purpose and then cover return behavior, side effects, and prerequisites in a logical flow. There is no redundant information or unnecessary elaboration.

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?

For a tool with no output schema and no annotations, the description adequately explains the return format, side effects, and configuration requirements. It does not mention error scenarios or edge cases like missing resource sets, but that is not strictly required for a download tool. The core information an agent needs to invoke and interpret the result is present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are already documented. The description adds some value by noting that .resx format always returns a ZIP and that multi-language (locale not passed) may return a ZIP, but this largely repeats what the schema's locale description says. It does not go into per-parameter details beyond what is already there, so the addition is modest.

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 tool exports translation content of a specified resource set from the i18n platform, using a specific verb ('导出'/export) and a specific resource ('资源集翻译'). It distinguishes itself from sibling tools like list_resource_sets and list_resource_keys, which list rather than export. The purpose is unambiguous.

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 implies when to use the tool: when you need downloaded translation content. It also provides a key prerequisite (environment variable I18N_API_KEY) that an agent must satisfy. It does not explicitly mention alternatives or exclusion conditions, but the sibling tools are clearly different in function, so the usage context is reasonably clear.

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

get_profile获取 i18n 替换配置A

按名称获取 i18n 平台上保存的替换配置详情,含 configJson。需配置环境变量 I18N_API_KEY。

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes配置名称

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the transparency burden. It discloses an authentication requirement, a returned data point ('含 configJson'), and '获取'/get conveys read-only semantics. It does not describe not-found or invalid-key behavior, leaving a minor gap.

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?

One compact sentence delivers purpose, scope, return content, and a setup prerequisite, with the key behavior front-loaded. Every clause adds information and there is no wasted wording.

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?

For a one-parameter read tool with no output schema, the description states the lookup key, the result's key content, and the environment requirement. Missing error or not-found behavior is a minor gap relative to the tool's low complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single parameter 'name' has full schema coverage ('配置名称'), and the description only reaffirms lookup by name. No additional type, format, or usage details are added beyond what the schema already provides.

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 combines a specific verb ('获取/retrieve'), a clear resource ('i18n 平台上保存的替换配置'), and a selection method ('按名称'), while naming a key return field ('configJson'). This makes it easy to distinguish from sibling tools like list_profiles and save_profile.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool: when you know the exact config name ('按名称获取'), and it states the prerequisite '需配置环境变量 I18N_API_KEY'. However, it does not explicitly say when not to use it or name the alternative tool for listing configs.

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

list_profiles列出 i18n 替换配置A

列出当前账号在 i18n 平台上保存的替换配置(不含 configJson 内容)。需配置环境变量 I18N_API_KEY。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the burden and usefully discloses account scoping, the deliberate exclusion of configJson content, and the authentication prerequisite. It does not describe return shape or errors, but for a zero-parameter read-only list this is acceptable.

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?

A single compact sentence that front-loads the verb and resource, then adds only two necessary details: the configJson exclusion and the environment variable requirement. No filler or redundancy.

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?

For a zero-parameter list tool, it covers what is returned, the account scope, the data exclusion, and setup requirements. It would be slightly stronger if it routed the agent to get_profile for configJson, but nothing essential for calling it successfully is missing.

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?

There are no input parameters, so the description has no parameter semantics to add beyond the empty schema. It does mention the only external input (I18N_API_KEY), which is extra context beyond the schema.

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 names a specific action (列出 'list'), a concrete resource (替换配置 on the i18n platform), and a scope (当前账号). Explicitly excluding configJson content also distinguishes it from profile-detail operations like get_profile.

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?

It gives clear context for when to invoke the tool: to list the current account's saved replacement configurations. It also states the required environment-variable setup (I18N_API_KEY), though it does not explicitly mention alternatives or when-not-to-use cases.

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

list_projects列出 i18n 项目A

列出当前账号在 i18n 平台上的全部项目(含资源集数量)。需配置环境变量 I18N_API_KEY。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
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 discloses the authentication requirement (I18N_API_KEY), which is valuable. However, it does not explicitly state that the operation is read-only, nor does it describe error behavior or any side effects. Since listing is inherently non-mutating, the lack of an explicit read-only statement is a minor gap, but the description adds some useful context beyond the tool name.

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 a single, compact sentence that front-loads the primary action and scope, then adds the key prerequisite. Every word serves a purpose, with no redundancy or fluff. It is optimally concise and well-structured.

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 there is no output schema, the description should convey the essential return information. It mentions that the result includes the resource set count, which is a key output feature. It also covers the authentication prerequisite. However, it does not specify the exact structure of each project (e.g., fields like ID, name), nor mention pagination or limits. For a simple list operation with no parameters, this is largely sufficient, but the missing field details could cause minor ambiguity. Overall, it is reasonably complete.

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 tool has zero parameters, and the schema coverage is 100% (vacuously). The description does not need to explain any parameter syntax, and it correctly adds no misleading parameter information. Per the rubric, a baseline of 4 applies when there are no parameters, and nothing in the description detracts from this.

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 states a specific action (列出/List), a clear resource (全部项目/all projects), and the scope (当前账号/current account). It also mentions the resource set count, which differentiates it from sibling tools like list_profiles or list_resource_sets. This is a precise and unambiguous purpose.

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 mentions the prerequisite of setting the I18N_API_KEY environment variable, which is a critical usage condition. It does not explicitly name alternatives or say when not to use this tool, but the context of siblings and the clear resource (projects vs profiles, resource sets) makes the intended use obvious. No misleading guidance is present.

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

list_resource_keys列出资源集内的 keyA

列出指定资源集中的全部资源 key(resourceId)及其是否有值。需配置环境变量 I18N_API_KEY。

ParametersJSON Schema
NameRequiredDescriptionDefault
projectIdNo项目 id(可选,用于项目维度过滤)
resourceSetYes资源集名称,如 portal.member

TDQS

A3.6/5.0
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 discloses the environment-variable requirement and indicates the output will include key presence ('是否有值'), which is helpful. But it does not mention read-only behavior, error conditions, pagination, or what happens if the required environment variable is missing.

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?

A single sentence that front-loads the core action and resource, then adds the value-presence detail and the environment-variable prerequisite with no wasted words.

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?

The tool is simple with two params and no output schema; the description explains what the call returns (resource keys and whether each has a value) and the setup prerequisite. It lacks a few edge details such as error behavior or projectId filtering semantics, but is largely sufficient for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters. The description adds little beyond naming the resource set; it does not clarify the optional projectId filtering behavior in the prose, but the schema covers it. Baseline 3 is appropriate.

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 states a specific action ('列出') and a clear resource scope: all resource keys within a specified resource set, including whether they have values. This distinguishes it from siblings like list_resource_sets by focusing on keys inside a set rather than the sets themselves, though it does not explicitly name alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies its use case: listing keys in a resource set, and it gives a necessary prerequisite ('需配置环境变量 I18N_API_KEY'). However, it provides no guidance on when to prefer this tool over related siblings such as list_resource_sets or download_resources, and no exclusion criteria.

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

list_resource_sets列出资源集A

列出当前账号在 i18n 平台上的全部资源集名称。需配置环境变量 I18N_API_KEY。

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the need for an environment variable but does not mention return format, pagination, error behavior, or authentication specifics. For a read-only list operation, this is adequate but not rich.

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?

Two sentences with no redundancy. The core purpose is front-loaded, and the environment variable note is placed second. Every sentence earns its place.

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?

Without an output schema, the description could specify the return structure (e.g., a list of strings) but only says 'resource set names'. It also omits edge cases like empty results or authentication failures, though these are minor for a simple list tool.

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 tool has zero parameters and the schema coverage is trivially 100%, so baseline 4 applies. The description adds no parameter info because none is needed.

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?

Description states a specific action: list all resource set names for the current account on the i18n platform. It clearly distinguishes from sibling tools like list_resource_keys (keys vs sets) and list_projects/list_profiles, so an agent can select it correctly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions a prerequisite (environment variable I18N_API_KEY) but gives no guidance on when to use this tool versus alternatives, nor any when-not conditions. It does not name sibling tools or exclusions.

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

preview_replacei18n 文件替换预览A

预览 i18n 文件替换结果,不写入资源库。返回 originalContent、content、generatedKeys 与 keyCount。需配置环境变量 I18N_API_KEY。 必须提供 configJson 或 profileName 之一。

ParametersJSON Schema
NameRequiredDescriptionDefault
contentYes要替换的文件完整内容
fileNameYes被替换文件的名称,用于生成 key(如 Home.vue;带目录前缀如 pages/member/list.vue 时 key 会包含目录信息)
configJsonNo替换配置 JSON(I18nReplaceConfigDto,与 profileName 二选一,优先级更高)
profileNameNo平台上已保存的配置名(与 configJson 二选一)
resourceSetNo非空时将生成的 key 写入该资源集(写入平台数据库,LocaleId=zh)
resourceSetByDirNo为 true 且提供了 resourceSet 时,实际资源集为 <resourceSet>.<fileName 的第一级目录>(与 CLI --resource-set-by-dir 一致,如 portal.member);fileName 无目录前缀时退化为 resourceSet 本身

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It effectively covers this: states the tool is non-destructive (does not write), declares the environment variable requirement (I18N_API_KEY), discloses the returned fields, and flags the configJson/profileName mutual-exclusivity constraint. This is solid coverage for a preview tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences with the core purpose and non-destructive trait front-loaded, followed by return values and requirements. There is no filler, and every clause earns its place. It could be marginally tighter, but it is well-organized and scannable.

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?

For a 6-parameter tool with no output schema and no annotations, the description covers the essentials: purpose, side-effect-free behavior, return fields (which substitutes for the missing output schema), environment prerequisite, and the parameter constraint. Minor gaps are acceptable given the schema already documents parameters fully.

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 schema already documents every parameter well (baseline 3). The description adds genuine value by stating '必须提供 configJson 或 profileName 之一' — a one-of requirement that the schema itself does not encode (neither is in the required list). This prevents an agent from calling with only fileName+content.

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 states a specific verb (preview/replace), the resource (i18n files), and the key behavioral trait that distinguishes it from the write-sibling: '不写入资源库' (does not write to the repository). It also names the return fields, making the tool's scope unambiguous even among siblings like replace_file.

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 clearly conveys the preview-only context ('预览...不写入资源库'), which implicitly tells an agent to use this tool when it wants to inspect a replacement before committing. However, it does not explicitly name the alternative (replace_file) or state when-not-to-use, leaving the sibling differentiation to inference.

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

replace_filei18n 文件替换A

调用 i18n 平台(https://i18n.codeini.com)文件替换 API,将普通代码文件转换为支持多语言的代码文件。返回替换后的 content、生成的 generatedKeys 与 keyCount。需配置环境变量 I18N_API_KEY(平台 API Key)。 必须提供 configJson 或 profileName 之一。 提供 translateTo(目标语言数组,如 ["en"])且带 resourceSet 时,替换后会把每个 key 机翻到目标语言并一并写入资源库(返回 translatedCount)。

ParametersJSON Schema
NameRequiredDescriptionDefault
contentYes要替换的文件完整内容
fileNameYes被替换文件的名称,用于生成 key(如 Home.vue;带目录前缀如 pages/member/list.vue 时 key 会包含目录信息)
configJsonNo替换配置 JSON(I18nReplaceConfigDto,与 profileName 二选一,优先级更高)
profileNameNo平台上已保存的配置名(与 configJson 二选一)
resourceSetNo非空时将生成的 key 写入该资源集(写入平台数据库,LocaleId=zh)
translateToNo配合 resourceSet 使用:写入源语言(zh)后,把每个生成的 key 机翻到这些目标语言(如 ["en"] 或 ["en","ja"]),译文以相同 id 写入同一资源集。需同时提供 resourceSet
resourceSetByDirNo为 true 且提供了 resourceSet 时,实际资源集为 <resourceSet>.<fileName 的第一级目录>(与 CLI --resource-set-by-dir 一致,如 portal.member);fileName 无目录前缀时退化为 resourceSet 本身
translateProviderNo机翻提供方(缺省用平台默认提供方,可用环境变量 I18N_TRANSLATE_PROVIDER)

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries full burden. It discloses side effects (writing generated keys to the platform database when resourceSet is provided, machine translation to target languages), return values (content, generatedKeys, keyCount, translatedCount), and the required environment variable. This is highly transparent about behavioral outcomes.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a compact set of sentences that front-loads the primary purpose and returns, then covers constraints and optional behavior. It is dense but well-organized, with each sentence adding essential information. Slight denseness prevents a perfect score.

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 8 parameters and no output schema, the description covers the core workflow, required conditions, side effects, and return values. It does not detail the exact structure of configJson, but that is beyond the scope of a tool description; the schema already identifies it as a DTO. The description is sufficiently complete for an agent to call the tool correctly.

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?

Although schema description coverage is 100%, the description adds critical semantics beyond the schema: the mutual exclusivity of configJson and profileName (with priority), the condition that translateTo requires resourceSet, and the explanation of resourceSetByDir behavior. These additions help the agent avoid invalid calls.

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 tool converts ordinary code files into multi-language capable code files via the i18n platform API, and lists the returned values (content, generatedKeys, keyCount). It distinguishes itself from siblings like preview_replace (which previews) and the listing tools by focusing on the actual replacement operation.

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?

It provides explicit conditions: must supply configJson or profileName, and translateTo requires resourceSet. It also mentions the prerequisite of setting I18N_API_KEY. However, it doesn't explicitly state when to prefer this over preview_replace or when not to use it, though the action is clearly the primary mutation tool among siblings.

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

save_profile保存 i18n 替换配置A

在 i18n 平台上创建或更新一个替换配置(config profile),供 replace_file/preview_replace 通过 profileName 复用。需配置环境变量 I18N_API_KEY。

ParametersJSON Schema
NameRequiredDescriptionDefault
nameYes配置名称
configJsonYes替换配置 JSON(I18nReplaceConfigDto)

TDQS

A3.9/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses that the operation is mutating (create/update) and requires an environment variable for authentication. However, it does not clarify overwrite behavior when the name already exists, validation failure modes, or whether the operation is idempotent.

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 short sentences with no redundancy. It front-loads the action and resource, then gives the reuse context and authentication requirement. Every sentence earns its place.

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?

For a simple 2-parameter tool with no output schema and no annotations, the description covers purpose, reuse context, and authentication. Gaps remain around update/overwrite semantics, expected return value, and error conditions, which an agent would need for fully confident invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/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 modest context by tying the name to profileName usage and identifying configJson as I18nReplaceConfigDto, but it does not meaningfully explain how to construct or format the configuration beyond what the schema already provides.

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 states a specific action (create or update), a specific resource (replacement config/profile on the i18n platform), and how it relates to sibling tools (reused by replace_file/preview_replace via profileName). This clearly distinguishes save_profile from listing, fetching, or applying profiles.

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 clearly indicates when to use this tool: to persist a reusable config for replace_file/preview_replace. It also gives a prerequisite (I18N_API_KEY). However, it does not explicitly contrast with list_profiles/get_profile or state when not to use it.

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

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 9 tool updatesv1.2.1
    • First observeddownload_resources
    • First observedget_profile
    • First observedlist_profiles
    • First observedlist_projects
    • First observedlist_resource_keys
    • First observedlist_resource_sets
    • First observedpreview_replace
    • First observedreplace_file
    • First observedsave_profile

TDQS

A4.2/5.0

Scored across 9 tools

Disambiguation5/5

Each tool targets a distinct resource/action: replace vs preview, profile management (list/get/save), and resource queries (projects/sets/keys/download). Descriptions clearly distinguish overlapping operations like replace_file and preview_replace.

Naming Consistency5/5

All tool names follow the same lower_snake_case convention with an action-first pattern (replace_, preview_, list_, get_, save_, download_). The naming is uniform and predictable across the entire set.

Tool Count5/5

9 tools are well-scoped for the purpose of i18n file replacement and associated profile/resource management. The count is comfortably within the ideal 3-15 range, and each tool earns its place.

Completeness4/5

Core workflows (preview, replace, profile create/update, and resource browsing/export) are fully covered. A minor gap is the absence of a profile deletion tool, leaving the profile lifecycle slightly incomplete, but agents can still work around this easily.

Related MCP Connectors

Related MCP Servers