Skip to main content
Glama
translated

Lara Translate MCP Server

by translated

detect_language

Read-onlyIdempotent

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

TableJSON Schema
NameRequiredDescriptionDefault
hintNoOptional language code hint to guide detection (e.g., 'en-EN').
textYesThe text to detect the language of. Can be a single string or an array of strings (up to 128 elements).
passlistNoOptional list of language codes to restrict detection results to.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageYesDetected language code (e.g., 'en-US')
contentTypeYesContent type of the analysed text
predictionsYesRanked list of candidate languages with confidence scores

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.0.0
    • removedOutput schema / additionalProperties
      Removed value: -{}
    • removedOutput schema / properties / predictions / items / additionalProperties
      Removed value: -{}
  2. Changed1 schema field changedv1.0.4
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": {},
      +  "properties": {
      +    "contentType": {
      +      "description": "Content type of the analysed text",
      +      "type": "string"
      +    },
      +    "language": {
      +      "description": "Detected language code (e.g., 'en-US')",
      +      "type": "string"
      +    },
      +    "predictions": {
      +      "description": "Ranked list of candidate languages with confidence scores",
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "confidence": {
      +            "description": "Confidence score between 0 and 1",
      +            "type": "number"
      +          },
      +          "language": {
      +            "description": "Candidate language code",
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "language",
      +          "confidence"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "language",
      +    "contentType",
      +    "predictions"
      +  ],
      +  "type": "object"
      +}
  3. Addedv1.0.2

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true and destructiveHint=false, so safety is covered structurally. The description adds the input-size ceiling (128 elements) and the multi-step orchestration behavior with translate, which the annotations do not convey. It does not disclose anything about latency or cost for large batches, so it falls short of a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose and output shape are front-loaded in the first two sentences, and the usage rule follows. The final sentence is dense with nested parentheticals, and part of the translate guidance is arguably over-explained for a detection tool, but nothing is wasted enough to obscure the core instruction.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, the description need not detail return values, and it covers input shape, limits, and workflow positioning. It leaves the optional 'hint'/'passlist' controls unexplained, which is the main remaining gap for a 3-parameter tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description restates the string-or-array shape and 128-element limit already documented in the schema, and says nothing about the 'hint' or 'passlist' parameters, which are the ones most likely to be misused.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence states a specific verb+resource ('Detects the language of the provided text'), and the second sentence names the outputs. It is trivially distinguishable from siblings like translate and list_languages, which do different jobs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit when-to-use rule ('whenever the user asks to know or confirm what language a text is written in'), covers the compound case with translation, and specifies call ordering plus what to report back. No inference is required about when this tool is the right choice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.