Skip to main content
Glama

Code Detector

CodeDetector
Read-only

Code Detector: Code Detector identifies the programming language of any submitted code snippet. It returns the canonical language name, readable title, and standard file extension for the detected code. (Cost: 20 credits)

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": {
      "code": "<code>"
    },
    "name": "CodeDetector"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesThe code snippet you want to detect the programming language of

Output Schema

NameRequiredDescriptionDefault
dataNo
errorNoError message, null on success
statusNo"ok" on success

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false and openWorldHint=true, so the safety profile is covered. The description adds two genuinely useful behavioral facts beyond that: the three return fields (canonical name, title, file extension) and a 20-credit cost, which matters for a metered API. It stops short of noting confidence behavior on ambiguous or mixed-language snippets.

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?

Two sentences, front-loaded with purpose before outputs and cost, with no filler. The opening 'Code Detector: Code Detector identifies...' redundantly restates the name/title, which is minor waste.

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 single-parameter, read-only detection utility with an output schema and clear annotations, this is essentially complete: purpose, return fields, and cost are all present. Only the handling of ambiguous or mixed-language snippets is unaddressed.

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?

With one parameter at 100% schema description coverage, the schema already explains that 'code' is the snippet to analyze. The description adds nothing about input constraints such as size limits, minimum length, or whether mixed-language input is accepted, so baseline 3 applies.

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?

States a specific verb (identifies) and resource (programming language of a submitted code snippet), which is unambiguous. It doesn't differentiate itself from sibling language-identification tools such as LanguageDetector or TextLanguage, which an agent would need to distinguish code from natural-language detection.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no exclusions, and no mention of alternative tools for language identification among the many siblings. The description only says what the tool does, leaving the agent to infer that LanguageDetector/TextLanguage serve different inputs.

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.