Skip to content

MCP tools ​

Each tool answers one text block that holds JSON. When the API refuses, the tool answers isError: true and the text <status> — <message>.

repository is always the id of a repository, from i18n_repositories. language is a tag such as fr or pt-BR. file is a file name such as common, never a path.

Call i18n_me first. It names the repositories and the languages that the token can write. Then call i18n_keys, and send its commit back to i18n_propose as readAt. Only i18n_propose writes: each other tool only reads, and its MCP annotation readOnlyHint is true.

i18n_repositories ​

read-only

The repositories to translate. Which repositories the editor translates, their source language and their targets.

Input: none.

The repositories that the account can read. An admin reads all of them. Any other account reads the repositories where it is a member.

Answer: a list of repositories.

FieldWhat it is
idThe identifier that the other tools take.
owner, nameThe repository on GitHub.
branchThe base branch.
localesPathThe folder of the locale files.
manifestPathThe manifest, from the root of the repository.
publishModecommit or pull_request.
sourceThe source language.
targetsThe other languages.

i18n_me ​

read-only

What this token may do. The repositories where this account is a member, and in each one its role, the languages it may propose in, and whether it writes the source. A translator writes proposals and does not publish. A reviewer or an owner also publishes.

Input: none.

A token gives the rights of its account, and no more (Access tokens).

Answer:

json
{
  "admin": false,
  "memberships": [{ "repositoryId": "…", "role": "translator", "languages": ["en", "de"], "writesSource": false }]
}

role is translator, reviewer or owner. A translator proposes. A reviewer or an owner also publishes, in the editor.

i18n_keys ​

read-only

The keys of a language. Every key of the source beside what one language says about it, filtered by state and by file. The answer carries the commit the values were read at; a proposal takes it back.

Input:

FieldTypeRequiredWhat it is
repositorystringyesThe repository to read, from i18n_repositories. At least 1 character.
languagestringyesThe language to read, which the repository must translate into. Matches ^[A-Za-z0-9_-]+$.
state"missing", "review", "translated", "all"noWhich keys to answer. missing is what there is work on. review is a translation whose source changed: was holds the old source. Default: "missing".
filestringnoOnly the keys of this file, for example common. Matches ^[A-Za-z0-9_-]+$.
offsetintegernoWhere to start, for a catalogue past one answer. Default: 0.

200 keys for each answer.

Answer:

FieldWhat it is
commitThe revision of the base branch that the values come from. Send it back as readAt.
sourceThe source language.
languageThe language read.
totalHow many keys match the filter.
offset, returnedWhere the page starts, and how many keys it holds.
moretrue if another page follows. Call again with offset + returned.
filesWithNoVersionThe files that this language does not have. They take no proposal.
entriesThe keys. See below.

Each entry:

FieldWhat it is
fileThe file of the key.
keyThe dotted path of the key.
sourceThe source text now.
valueThe text of the language on the base branch, or null.
statemissing, translated or review.
wasFor review only: the source text that the translation answers.
emptytrue if the key is left empty on purpose in this language. value is "".

The server holds one reading of a catalogue for 5 minutes. Every page of a listing answers the commit of the first page.

i18n_key ​

read-only

One key, with its context. One key: what the source says, what the target says, and its state. The file and the dotted path are the context — analysis.requests_export_hint says what the string is for, and a translation without it is a wrong translation.

Input:

FieldTypeRequiredWhat it is
repositorystringyesThe repository to read, from i18n_repositories. At least 1 character.
languagestringyesThe language to read, which the repository must translate into. Matches ^[A-Za-z0-9_-]+$.
filestringyesThe file of the key, for example common. Matches ^[A-Za-z0-9_-]+$.
keystringyesThe dotted path of the key, as i18next reads it. At least 1 character.

Answer: { "found": true, "commit": "…", "source": "fr", "entry": { … } }, with the same entry as i18n_keys.

If the key does not exist, or if the file has no version in the language, the answer is { "found": false, "reason": "…" }.

i18n_propose ​

writes It writes a commit on the repository, and deletes nothing.

Propose a batch of translations. Writes a whole batch as one commit on the branch of its language. Three hundred keys are one commit, not three hundred. Nothing is published: a reviewer does that.

Input:

FieldTypeRequiredWhat it is
repositorystringyesThe repository to read, from i18n_repositories. At least 1 character.
languagestringyesThe language to read, which the repository must translate into. Matches ^[A-Za-z0-9_-]+$.
readAtstringyesThe commit the keys were read at, taken from i18n_keys or i18n_key. Every page of one listing answers the same one. It is what lets a publication refuse a key whose source moved since — never invent one, and never mix the values of two listings in one call. Matches ^[0-9a-f]{40}$.
valuesarray of objectyesThe whole batch. One call is one commit, so three hundred keys are three hundred keys, not three hundred commits. From 1 to 2000 items.

Each item of values:

FieldTypeRequiredWhat it is
filestringyesThe file of the key, for example common. Matches ^[A-Za-z0-9_-]+$.
keystringyesThe dotted path of the key. At least 1 character.
valuestringyesThe text in the language of the batch.
emptybooleannotrue leaves the key empty on purpose in this language, with value "". Use it only when the source asks for no text in this language, never to skip a key. A key sent without it loses its mark.

The branch is i18n/<language>.

Answer:

json
{ "commit": "…", "branch": "i18n/en", "readAt": "…", "keys": 42, "files": ["common", "checkout"] }

i18n_proposals ​

read-only

What is waiting on a language. The batches the branch of a language holds and the base does not, with who wrote each one.

Input:

FieldTypeRequiredWhat it is
repositorystringyesThe repository to read, from i18n_repositories. At least 1 character.
languagestringyesThe language to read, which the repository must translate into. Matches ^[A-Za-z0-9_-]+$.

Answer: a list of batches.

FieldWhat it is
commitThe commit of the batch.
messageIts commit message.
authorThe account that proposed it.
atWhen.
readAtThe revision that the batch answers.