Skip to main content
Glama

Code Explain

code_explain
Read-only

Explains a code snippet (max 20,000 characters): detected language, a summary, a step-by-step explanation, the functions and classes it defines, and possible bugs and security issues with line numbers. Line numbers outside the snippet are dropped. Model-written: a finding is a lead to check, not a verified defect. Price: $0.002 in USDC per successful call, paid with x402 (Base, Solana or Arc); failed calls are not charged.

Input Schema

NameRequiredDescriptionDefault
codeYesSource code snippet (max 20,000 characters)
languageNoLanguage if you know it (optional; otherwise detected)

Output Schema

NameRequiredDescriptionDefault
noteNo
linesNo
stepsNo
issuesNo
summaryNo
languageNo
checkedAtNo
functionsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • addedOutput schema / properties / checkedAt
      Added value: +{}
    • addedOutput schema / properties / functions
      Added value: +{}
    • addedOutput schema / properties / issues
      Added value: +{}
    • addedOutput schema / properties / language
      Added value: +{}
    • addedOutput schema / properties / lines
      Added value: +{}
    • addedOutput schema / properties / note
      Added value: +{}
    • addedOutput schema / properties / steps
      Added value: +{}
    • addedOutput schema / properties / summary
      Added value: +{}
  2. Added

TDQS

A4.2/5.0
Behavior5/5

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

Even with readOnlyHint and openWorldHint declared, the description adds substantial behavior: truncation of out-of-snippet line numbers, a model-written caveat that findings are leads rather than verified defects, and a full pricing/charging model (x402, USDC, failed calls not charged). This goes well beyond what the annotations convey.

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 the verb and a dense but useful list of outputs, followed by edge-case behavior and pricing. Every clause carries information, though the single long sentence is heavy; structure is good but not maximally scannable.

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?

With an output schema present, return values need no explanation, and the description still covers scope, input limit, edge-case handling, model-reliability caveat, and cost. Nothing an agent needs to invoke it correctly is missing.

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%, so both parameters are already documented in the schema. The description restates the 20,000-character cap and the language-detection fallback but adds no syntax or format detail beyond the schema, so the baseline of 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?

States a specific verb (explains) and resource (code snippet), then enumerates exactly what the output contains: detected language, summary, step-by-step explanation, functions/classes, bugs and security issues with line numbers. No sibling tool overlaps this space, so the agent can identify it immediately.

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 implied by the output enumeration and the 20,000-character limit, but there is no explicit 'use this when...' framing and no named alternative. A reader infers it's for analyzing a code snippet, but nothing routes them between this and, say, validate or sql_generate.

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