Skip to main content
Glama

code explain

code_explain
Read-only

Explain code for any audience: purpose, step-by-step logic, each function's inputs and outputs, dependencies, side effects, complexity, gotchas and a ready-to-paste doc comment. Paste code or a GitHub file URL. Costs $0.013 USDC per call (x402).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "code_explain"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNo
codeNo
audienceNo

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 declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds a genuinely useful behavioral fact not present in structured data: the call costs $0.013 USDC via x402, which materially affects an agent's decision to invoke it. It does not disclose size limits on pasted code or latency/return-shape expectations.

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 the deliverable list, no filler. The enumeration is long but each item is meaningful, and the cost note is correctly placed at the end where it does not crowd the primary purpose.

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?

There is no output schema, and the description compensates well by enumerating the return contents (logic walkthrough, dependencies, gotchas, ready-to-paste doc comment). Payment terms are disclosed. The remaining gap is parameter guidance for a tool whose schema documents none of its three parameters.

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 0%, so the description carries full burden, and it does touch all three parameters: `code` ("Paste code"), `url` ("a GitHub file URL"), and `audience` ("for any audience"). However, it does not state whether code or url is required or that they are alternatives, what values `audience` accepts, or any format constraints.

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 (explain) and resource (code) and enumerates the exact deliverables: purpose, step-by-step logic, per-function inputs/outputs, dependencies, side effects, complexity, gotchas and a doc comment. This is functionally distinct from siblings like code_run, code_review, and code_tests, but none of those siblings are named, so it stops short of a 5.

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?

"Paste code or a GitHub file URL" gives the input modality, which implies usage context, but there is no explicit when-to-use guidance or routing versus code_review, report_code_audit or sql_explain. Usage must be inferred from the deliverable list.

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