Translate text
translateTranslate text to a target language with automatic source detection, HTML input support, and optional alternative translations.
Instructions
Translate text using a self-hosted LibreTranslate instance (POST /translate). Set source to "auto" to let LibreTranslate detect the input language; the detected language and its confidence are then reported in the result. format "html" treats the input as HTML; LibreTranslate does not support alternatives for HTML input, so format "html" with alternatives > 0 is rejected before the request is sent. With format "text" and alternatives > 0, the other candidate translations returned by LibreTranslate are included when the response carries them, and an explicit note is returned when it does not.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"q": "<q>",
"target": "<target>"
},
"name": "translate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Text to translate. | |
| format | No | Input format: "text" (default) or "html". | text |
| source | No | Source language code, or "auto" to let LibreTranslate detect it. | auto |
| target | Yes | Target language code. Use the languages tool to list the codes this instance supports. | |
| alternatives | No | Number of alternative translations to request (0-10). Only supported with format "text". |