translate-text
Translate text to a target language via DeepL API, with options for glossaries, formality, and preserving formatting for accurate results.
Instructions
Translate text to a target language using DeepL API. Review all available optional parameters and use those applicable to your scenario for best results. When the translation includes a glossary, you must specify the source language as well as the target language. If the user requests a glossary by name instead of by id, you can use the list-glossaries tool to get a name for each id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to translate, as a single string or an array of strings handled independently | |
| context | No | Recommended: describe what this text is about (e.g., 'Technical documentation for a software API'). Improves translation accuracy but is not itself translated. | |
| styleId | No | Style rule ID to apply. Use the list-style-rules tool to discover available style rules. | |
| formality | No | Controls formality: 'less' for informal, 'more' for formal/polite, 'prefer_less'/'prefer_more' to prefer but fall back to default | |
| glossaryId | No | Glossary ID to ensure consistent terminology translation | |
| sourceLangCode | No | source language code, in standard ISO-639-1 format (e.g. 'en', 'de', 'fr'), or leave empty for auto-detection | |
| splitSentences | No | Sentence splitting: '0' disables, '1' (default) splits on punctuation and newlines, 'nonewlines' preserves line breaks | |
| targetLangCode | Yes | target language code, in standard ISO-639-1 format (e.g. 'en-US', 'de', 'fr') | |
| customInstructions | No | Array of custom instructions to guide translation style (max 10 instructions, 300 chars each) | |
| preserveFormatting | No | Set to true to preserve original formatting - recommended for markdown, code blocks, HTML, or any structured text |