Skip to main content
Glama

ai_explain_code

Read-only

AI code explainer — Explain what a code snippet does in plain English, with key steps and any bugs or risks. Pass ?code= and optional ?language=. Price: $0.008 USDC (Base, via x402).

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": "ai_explain_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesthe code snippet
languageNooptional language name

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover safety (readOnlyHint, destructiveHint=false, openWorldHint), and the description adds genuinely new behavioral context: the paid-per-call cost of $0.008 USDC on Base via x402, plus the shape of the returned explanation. It does not mention limits on snippet length or failure modes for non-code input.

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 compact sentences, front-loaded with the core purpose and ending with the cost, which is the detail an agent most needs before spending money. The 'AI code explainer —' lead-in mildly duplicates the title but costs little.

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 two-parameter read-only AI tool with no output schema, the definition covers purpose, output components, and payment. The absence of any return-format or length expectations is a minor gap given how simple the schema is.

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 ('code', 'language') are already documented in the schema. The description merely restates them as query parameters, adding no constraint, format, or length guidance beyond what the schema provides.

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 gives a specific verb and resource (explain a code snippet in plain English) and even enumerates the output components: key steps, bugs, and risks. It is clearly distinct from neighbors like ai_summarize or ai_translate, though it never names an alternative to contrast against.

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: 'Pass ?code= and optional ?language=' tells the agent how to call it, but there is no statement of when to choose this over ai_summarize, ai_qa, or ai_regex, and no exclusions or prerequisites beyond the price note.

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