Spanish Total.js
English
Documentation For AI agents
Contents

Let an agent translate

Give an AI agent a translator token and let it fill the missing translations through MCP or the JSON API.

.md
  1. Enable the language in Languages, for example Spanish.
  2. In Agent tokens, create a token with the translator role, for the projects to translate, with an expiry.
  3. Connect the agent to /mcp/ with the token. It gets Translations_list (what is missing or outdated), Translations_read (the original and its translation) and Translations_save. Agents without MCP use these two calls of the JSON API:
# What is missing or outdated
curl -X POST https://docs.example.com/api/ -H "Authorization: Bearer docs_…" -H "Content-Type: application/json" \
  -d '{"schema":"translations?language=es"}'

# Save one translation
curl -X POST https://docs.example.com/api/ -H "Authorization: Bearer docs_…" -H "Content-Type: application/json" \
  -d '{"schema":"translations_save","data":{"reftype":"pages","refid":"…","language":"es","fields":{"title":"…","body":"…"}}}'
  1. The agent reads each original with Translations_read (translations_read in the JSON API).

Every translation is in the history with the name of the token. Review them in Translations, and revoke the token when you are done.

Made in Europe