Skip to main content
Glama

Language detection: detect the language of a text

text_language
Read-only

Language detection for a text: the most likely language with its ISO 639-3 and 639-1 codes and English name, plus the next candidates with relative scores, using trigram statistics for 82 major languages (franc-min). Works best above about 20 characters; very short or mixed text returns und (undetermined). Local, no outside service. Use to route messages, pick a translation target or filter content by language. Example: text=Det här är en mening skriven på svenska om väder och resor.. Price $0.01/call via x402 USDC or a card key (/credits), first 25 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not free.

Input Schema

NameRequiredDescriptionDefault
textYesThe text (up to 10,000 characters)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover read-only, non-destructive, non-idempotent. The description adds real context: it runs locally with no external service, the 10k character limit, that text under about 20 characters or mixed text returns 'und', and that each call costs $0.01 with the first 25 free, so repeats are not free. One small tension: 'Local, no outside service' does not sit perfectly with openWorldHint=true, but that is an annotation precision issue, not a claim that the tool behaves differently.

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 front-loaded with purpose, output shape, and engine, then limits, then the use cases. The trailing pricing and billing sentence is long but affects repeat-call decisions, so it earns its place. A small typo (doubled period in the Swedish example) is the main blemish.

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?

For a one-parameter, read-only tool with no output schema, the description covers the return values, the accuracy caveats, the failure mode, and the cost model. An agent has everything it needs to call this correctly or skip it.

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% for the single 'text' parameter, so the baseline is 3. The description goes beyond it by adding the practical lower bound (about 20 characters) and the 'und' outcome for short or mixed input, which the schema does not say.

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?

It states a specific verb and resource (language detection for a text). It also names the underlying engine (franc-min trigrams, 82 major languages) and the exact output shape (ISO 639-3/639-1 codes, English name, next candidates). That is enough to distinguish it from the text_stats/text_keyword_density/text_extract siblings.

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?

The description gives concrete usage contexts: route messages, pick a translation target, filter content by language. It does not name a competing sibling or state exclusions, but the invocation conditions are clear.

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