Skip to main content
Glama

Detect language

detect_language
Read-onlyIdempotent

Detect the language of up to 20,000 characters. Uses a local Unicode-script + stopword/diacritic heuristic; no upstream call. Returns a language code, confidence, reliability flag and alternatives. Billing: free by default (COST_DETECT_LANGUAGE=0).

Input Schema

NameRequiredDescriptionDefault
textYesText to identify. Up to 20,000 characters; longer samples improve accuracy.
idempotency_keyNoOptional per-job key; relevant when COST_DETECT_LANGUAGE is above 0 (gateway billing).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Goes well past the annotations by disclosing the mechanism (local Unicode-script + stopword/diacritic heuristic), that no upstream call is made, and the billing model including the COST_DETECT_LANGUAGE flag. Since there is no output schema, naming the returned fields (language code, confidence, reliability flag, alternatives) is genuinely load-bearing information.

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?

Three compact sentences; the core capability and the character limit are front-loaded, followed by mechanism, return shape, and billing in descending priority. The env-var reference is slightly jargon-heavy but earns its place by answering a cost question.

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 two-parameter read-only tool with no output schema, the description covers input limits, the implementation's accuracy tradeoffs, the returned fields, and cost — everything an agent needs to call it and interpret the result without guessing.

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% and both parameters carry their own descriptions, including the accuracy tip and the idempotency_key billing note. The description's length ceiling and billing mention duplicate the schema rather than adding new parameter semantics, so baseline 3 applies.

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?

Opening sentence gives a specific verb and resource (detect the language) plus an explicit input bound (20,000 characters). It is clearly distinguishable from the translate_* siblings, which transform text rather than identify it.

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

Usage Guidelines3/5

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

No sentence states when to choose this over alternatives or what the typical workflow is (e.g., call before translate_text to pick a target language). Usage is only implied by the tool's obvious role, so the guidance is adequate but thin.

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.