Skip to main content
Glama

sarvam_detect_language

Detect the language and script of input text and return BCP-47 codes for locale identification and translation routing.

Instructions

Identify the language and script of input text. Returns BCP-47 codes.

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": {
      "input": "<input>"
    },
    "name": "sarvam_detect_language"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose the return format (BCP-47 codes) — genuinely useful since there is no output schema. However, it says nothing about read-only/no-side-effect behavior, how ambiguous or multi-language text is handled, or whether confidence or multiple candidates are returned.

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?

Two short sentences, purpose first then return format, with no filler. Every sentence adds information an agent can use.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter utility with no output schema, the description covers what the tool does and what it returns, which is most of what an agent needs. The remaining gap is edge-case behavior on ambiguous text and the exact return shape.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description needed to compensate for the single 'input' parameter and does not — it never mentions that input is plain text capped at 2000 characters or anything about accepted formats. Only the self-explanatory parameter name carries meaning here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource ('Identify the language and script of input text'), which is clearly distinct from translate, transliterate, chat, and the speech tools. It stops short of explicitly naming a sibling it differs from, but the purpose is unambiguous.

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?

Usage is only implied by the purpose: an agent can infer it should call this when it needs to know a text's language. There is no when-not guidance, no mention of using it as a precursor to sarvam_translate, and no note on ambiguous or mixed-language input.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.