Skip to main content
Glama

Agent Data Hub

Detect the language of a text

util_language
Read-onlyIdempotent

Detect which language a text is written in (82 languages incl. English, Spanish, Arabic, Chinese, Hindi, Urdu, Russian, Portuguese, French, German, Japanese, Turkish…). Returns ISO 639-1 and 639-3 codes, English name, confidence, a reliable flag and ranked alternatives. Offline n-gram model: instant, no LLM cost. Use to route support tickets, pick a translation target, filter scraped content or reply in the user's language. Best with 20+ characters. Price: $0.001 per call (USDC on Base via x402); the first 10 calls per day are free.

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": "util_language"
  }
}

Input Schema

NameRequiredDescriptionDefault
topNoHow many candidates to return incl. the best, 1–10 (default 3)
textYesText to classify (max 100,000 chars; first 5,000 used)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/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 implementation (offline n-gram model), latency and cost profile ('instant, no LLM cost'), an explicit price with a free daily quota, and that only the first 5,000 characters are analyzed. That is exactly the operational context an agent needs before spending money or truncating input.

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?

Purpose and return shape are front-loaded, with cost and usage notes trailing. The parenthetical list of sample languages is somewhat expendable but does communicate breadth cheaply; overall it is dense without being padded.

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?

With no output schema present, the description still enumerates the return payload (ISO 639-1 and 639-3 codes, English name, confidence, reliable flag, ranked alternatives) and covers cost, limits, and truncation. An agent can call it correctly and interpret results without further information.

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 both parameters are already self-documenting; the description adds only the practical hint that 20+ characters improve accuracy, and says nothing about the `top` parameter. Baseline 3 is appropriate when the schema carries the parameter burden.

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 which language a text is written in') and immediately quantifies scope (82 languages with examples). Nothing in the util_* sibling list overlaps with language identification, so an agent can unambiguously select this tool.

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?

Gives concrete triggering scenarios (routing support tickets, picking a translation target, filtering scraped content, replying in the user's language) plus a quality precondition ('Best with 20+ characters'). It lacks any explicit when-not guidance, but no sibling tool is a plausible substitute, so the omission is minor.

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