Skip to main content
Glama

Detect Language

detect_language
Read-onlyIdempotent

Detect the language of text.

Supports 176 languages using fastText. Sub-1ms inference latency. Returns ISO 639-1 codes with confidence scores.

Args: text: Text to identify the language of. top_k: Number of top language predictions to return (default: 3).

Returns: dict with keys: - language (str): Top predicted language ISO 639-1 code - confidence (float 0-1): Confidence for top prediction - predictions (list): Top-k predictions, each with: - language (str): ISO 639-1 code - confidence (float 0-1): Prediction confidence

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText to identify the language of
top_kNoNumber of top language predictions to return

TDQS

A4.5/5.0
Behavior5/5

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

The description goes well beyond the annotations (readOnlyHint, idempotentHint, destructiveHint) by disclosing the model (fastText), language count (176), latency (sub-1ms), and a detailed return structure including ISO 639-1 codes and confidence scores. This gives the agent a clear expectation of behavior and output format, fully leveraging the absence of an output schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a brief intro paragraph, followed by Args and Returns blocks. Every sentence contributes: the intro gives purpose and key capabilities, the Args explain parameters (even though redundant), and the Returns clarify the output shape. It is front-loaded with the purpose and keeps details organized, with no 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?

Given that there is no output schema, the description's detailed Returns section is essential and it covers it thoroughly. It also communicates performance characteristics and language coverage. For a simple, read-only tool, this is complete: the agent knows what to input, what to expect, and what the result looks like.

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?

The input schema already provides complete descriptions for both 'text' and 'top_k' (100% coverage), and the description's Args section merely reiterates them without adding new meaning such as allowed formats, constraints beyond maxLength, or edge-case behavior. The default for top_k is also already in the schema. Thus the description adds no extra semantic value over what the schema provides.

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?

The description opens with a clear verb-resource statement: 'Detect the language of text.' It is unmistakably distinct from sibling tools like sentiment analysis or translation, and the scope (176 languages, ISO codes) further reinforces its specific purpose.

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 does not explicitly name alternatives or say 'use this instead of X,' but the specificity of the task (language detection) is self-evident given the sibling list. It also mentions sub-1ms latency, which hints at performance-conscious use cases. However, it lacks explicit when-not-to-use guidance, so it's not a 5.

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.

TDQS

A3.6/5.0
Disambiguation4/5

Most tools map cleanly to distinct capabilities, and the descriptions make the intended use clear. A few adjacent pairs—extract_entities vs link_entities_to_wikidata and detect_pii vs detect_conversational_pii—require careful selection, but they are distinguishable by their stated outputs.

Naming Consistency4/5

Names are uniformly lowercase snake_case and mostly follow a verb_object pattern, such as analyze_*, detect_*, extract_*, summarize_text, and translate_text. A few outliers like aspect_sentiment, fraud_feedback, and knowledge_ingest break the verb-first feel, but the overall pattern remains predictable.

Tool Count3/5

At 22 tools, this is on the heavy side of the borderline range. Each tool has a distinct job, but the mix of core NLP, safety, fraud, health-checking, and knowledge-base management makes the surface feel sprawling rather than tightly scoped.

Completeness3/5

The core NLP coverage is broad: sentiment, toxicity, PII, entities, QA, summarization, translation, and groundedness are all present. However, the knowledge-base tools support ingest/list/query but no delete or update, creating a dead end when documents need correction or removal.

Resources