Skip to main content
Glama

detect_language

Read-onlyIdempotent

utilpeek: Detect the language of a text. To translate use translate_text. Returns the most likely language (ISO 639-1 and 639-3 code, name, confidence) and 3 alternatives, from an offline ensemble of lingua (Apache-2.0) and langid.py (BSD-2-Clause) over 75 languages; reliable is true only with at least 20 letters and confidence 0.6 or more; mixed-language text sets mixed and lists each language's share of letters in languages. Short text is often flagged unreliable; text with no letters is a 422 no_text (not charged). Typically under 0.1 s (a few seconds on the worker's first call). Price: USD 0.001. Free: 10 utilpeek calls per IP per UTC day. The submitted text is never logged or stored. Docs: https://tanod.dev/learn/language-detection-api.html

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": {
      "text": "<text>"
    },
    "name": "detect_language"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe text (at most 20,000 characters).

Output Schema

NameRequiredDescriptionDefault
noteNo
errorNoOnly on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object.
mixedNo
sourceNo
lettersNo
languageNo
reliableNo
languagesNo
alternativesNo
chars_analyzedNo
languages_supportedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / languages
      Added value: +{
      +  "type": [
      +    "array",
      +    "null"
      +  ]
      +}
    • addedOutput schema / properties / mixed
      Added value: +{
      +  "type": [
      +    "boolean",
      +    "null"
      +  ]
      +}
  2. Changed5 schema fields changed
    • removedInput schema / properties / text / title
      Removed value: -"Text"
    • removedInput schema / title
      Removed value: -"detect_languageArguments"
    • removedOutput schema / properties / alternatives / items
      Removed value: -{
      -  "properties": {
      -    "code": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "confidence": {
      -      "type": [
      -        "number",
      -        "null"
      -      ]
      -    },
      -    "iso639_3": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    },
      -    "name": {
      -      "type": [
      -        "string",
      -        "null"
      -      ]
      -    }
      -  },
      -  "type": [
      -    "object",
      -    "null"
      -  ]
      -}
    • removedOutput schema / properties / language / properties
      Removed value: -{
      -  "code": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "confidence": {
      -    "type": [
      -      "number",
      -      "null"
      -    ]
      -  },
      -  "iso639_3": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "name": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  }
      -}
    • removedOutput schema / properties / source / properties
      Removed value: -{
      -  "library": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "license": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  },
      -  "url": {
      -    "type": [
      -      "string",
      -      "null"
      -    ]
      -  }
      -}
  3. Changed1 schema field changed
    • addedOutput schema / properties / source / properties / url
      Added value: +{
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "alternatives": {
      +      "items": {
      +        "properties": {
      +          "code": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "confidence": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "iso639_3": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "name": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "type": [
      +          "object",
      +          "null"
      +        ]
      +      },
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "chars_analyzed": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "error": {
      +      "description": "Only on an error result: an object {code, message}, or the reason string of an x402 PaymentRequired object."
      +    },
      +    "language": {
      +      "properties": {
      +        "code": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "confidence": {
      +          "type": [
      +            "number",
      +            "null"
      +          ]
      +        },
      +        "iso639_3": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "name": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    },
      +    "languages_supported": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "letters": {
      +      "type": [
      +        "integer",
      +        "null"
      +      ]
      +    },
      +    "note": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "reliable": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "source": {
      +      "properties": {
      +        "library": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        },
      +        "license": {
      +          "type": [
      +            "string",
      +            "null"
      +          ]
      +        }
      +      },
      +      "type": [
      +        "object",
      +        "null"
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  5. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: discloses the underlying engines and licensing, coverage of 75 languages, the 'reliable' threshold (20+ letters, confidence ≥0.6), mixed-language handling, that no_text errors are not charged, latency profile including first-call cost, price and free-tier limits, and a no-logging privacy guarantee. This is the kind of behavior an agent needs before deciding whether to trust or budget for the call.

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?

Front-loads purpose and the sibling alternative in the first sentence, then packs the rest into one dense but organized paragraph with consistent key naming. A few clauses (licenses of the underlying libraries) are marginally decorative for an agent, but nothing is redundant with the schema.

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

Completeness5/5

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

Even though an output schema exists, the description still summarizes the key returned fields (code, name, confidence, alternatives, reliable, mixed, per-language shares), and covers error behavior, latency, cost, and privacy. Nothing an agent needs to decide or act on is missing.

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

Parameters4/5

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

Schema coverage is 100% and there is only one parameter, so the baseline is already a 3. The description adds real meaning about what the input value does: letter count drives the 'reliable' flag and the languages share breakdown, and letter-free input triggers a 422.

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?

States a specific verb and resource ('Detect the language of a text') and immediately names the sibling that handles the adjacent task (translate_text), so an agent can separate this from translation without opening either schema.

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

Usage Guidelines4/5

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

Explicitly routes translation requests to translate_text and explains the conditions under which results should be distrusted: short text is often unreliable, and text with no letters yields a 422 no_text. It stops short of spelling out when *not* to call it at all, but the routing and reliability caveats give clear operational context.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources