Skip to main content
Glama

Detect the language of a text (ISO 639 codes)

lang
Read-only

The language of a text with franc-min: ISO 639-3 and ISO 639-1 codes, the English name, confidence from 0 to 1, the script (Latin, Cyrillic, Arabic...) and the three next most likely languages. Send texts= (a JSON array of up to 20 strings) for a batch. Under 20 characters the answer is und with a note. 61 languages. Takes about 13 s; allow a 30 s timeout. Price: $0.002 per successful call, paid with x402 (USDC on Base, Solana and 10 more networks); failed calls are not charged.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "lang"
  }
}

Input Schema

NameRequiredDescriptionDefault
textNoUp to 5,000 characters
textsNoAlternative: a JSON array of up to 20 strings, e.g. ["Hallo","Merhaba"]

Output Schema

NameRequiredDescriptionDefault
countNo
lengthNo
scriptNo
resultsNo
iso639_1No
languageNo
checkedAtNo
confidenceNo
alternativesNo
languageNameNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "alternatives": {},
      +    "checkedAt": {},
      +    "confidence": {},
      +    "count": {},
      +    "iso639_1": {},
      +    "language": {},
      +    "languageName": {},
      +    "length": {},
      +    "results": {},
      +    "script": {}
      +  },
      +  "type": "object"
      +}
  2. Added

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the readOnly/openWorld annotations, the description discloses the underlying model, language coverage, output fields, short-text behavior, approximate latency, timeout allowance, x402 payment model, price, and that failed calls are not charged. This is unusually strong behavioral context for an agent deciding whether and how to call the tool.

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 description is dense but front-loads the core output and batch behavior before operational details like latency and pricing. The first sentence is a fragment, but the remaining wording is efficient and avoids fluff.

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?

The tool has an output schema, so return structure is already covered, and the description supplies the operational details an agent needs: batch mode, short-input behavior, latency, timeout, and payment. Nothing critical for correct invocation appears to be missing.

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 coverage is 100%, so the schema already documents both text and texts parameters, including the 5,000-character and 20-string limits. The description reinforces the batch mode and adds the under-20-character caveat, but does not add substantial parameter meaning beyond the schema.

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

Purpose4/5

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

The description identifies language detection using franc-min and specifies the returned signals: ISO 639 codes, English name, confidence, script, and top alternatives. It is clearly a language-identification tool rather than one of the sibling text transformation tools, though it does not explicitly contrast itself with any sibling.

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?

It gives clear usage context: use text= for one string or texts= for a JSON array batch, and short inputs under 20 characters return 'und' with a note. It also states latency and timeout expectations, but does not explicitly say when not to use it versus alternatives such as a generic classifier.

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