Skip to main content
Glama

Agent Data Tools: Utilities

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 10 free; failed calls free. Reads or computes only and changes nothing; each call is charged, so repeats are not 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": "text_language"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesThe text (up to 10,000 characters)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, openWorldHint=false and destructiveHint=false, so the safety profile is covered. The description does add real value beyond that: the underlying engine (franc-min trigram statistics), the 82-language scope, the short/mixed-text 'und' behavior, and per-call billing of $0.01 with 10 free calls. However, the pricing/marketing tail is verbose and the billing detail is closer to commercial boilerplate than invocation-critical behavior.

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-loaded with capability, then output shape, then constraints, then use cases, then billing — a sensible order. Minor waste: the pricing/key sentence is long and partly duplicated ('Price $0.01/call ... failed calls free' plus 'each call is charged'), and the example text ends with a doubled period.

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?

There is no output schema, and the description fully compensates by enumerating the return fields, their ordering, and relative-score semantics. For a one-parameter read-only detector, an agent has everything needed: input limits, reliability threshold, fallback value, and cost model.

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?

With a single parameter at 100% schema coverage, the baseline is 3, but the description adds genuine semantics the schema lacks: the ~20-character reliability threshold and the 'und' fallback for very short or mixed text. The example input further clarifies expected shape. The 10,000-character cap is left to the schema.

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?

Names a specific verb and resource ('Language detection for a text') and states exactly what the output contains: the most likely language with ISO 639-3/639-1 codes and English name plus next candidates with relative scores. This is immediately distinguishable from siblings like text_stats or ai_classify.

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 use cases ('route messages, pick a translation target, filter content by language') and a practical precondition ('works best above about 20 characters'). It does not name a sibling tool as an alternative or state when-not-to-use, so it stops short of full routing guidance.

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