detect_language
Determine a text's language, even across multiple inputs, and return detected language, content type, and confidence scores. Use before translating when users ask what language it is.
Instructions
Detects the language of the provided text. Returns the detected language, content type, and a list of predictions with confidence scores. Accepts a single string or an array of strings (up to 128 elements). Use this tool explicitly whenever the user asks to know or confirm what language a text is written in — including when that request is combined with a translation request (e.g., 'detect the language of this text and translate it into English'). In that case, call this tool first, tell the user which language was detected, and only then call the translate tool (you do not need to pass the detected language as 'source' to translate — translate can auto-detect on its own — but the user still expects to be told the result of detection).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hint | No | Optional language code hint to guide detection (e.g., 'en-EN'). | |
| text | Yes | The text to detect the language of. Can be a single string or an array of strings (up to 128 elements). | |
| passlist | No | Optional list of language codes to restrict detection results to. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| language | Yes | Detected language code (e.g., 'en-US') | |
| contentType | Yes | Content type of the analysed text | |
| predictions | Yes | Ranked list of candidate languages with confidence scores |