Skip to main content
Glama

explain_code

Explains what code does, detailing control/data flow and non-obvious behavior. Provide code or file path.

Instructions

Explain what code does, including control/data flow and non-obvious behavior.

Provide exactly one of code or file_path. Explanations are usually fast enough that think=False (the default) is sufficient.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNo
thinkNo
file_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries full burden. It mentions that explanations are usually fast, implying low latency, but does not disclose other behavioral traits like access to file system, error handling, or rate limits. The output schema exists, so return format disclosure is not required.

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?

The description is extremely concise, with two clear sentences. The first front-loads the purpose, and the second provides critical usage guidance. No unnecessary words.

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?

Given the tool has 3 parameters (0 required) and an output schema, the description covers purpose, parameter usage, and a hint about performance. It could mention what happens if neither code nor file_path is provided, but overall it's sufficiently complete for its complexity.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It meaningfully explains that code and file_path are mutually exclusive and that think=False is usually sufficient. This adds significant clarity beyond the schema's defaults, though it could detail accepted formats for code or file_path.

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?

The description clearly states the tool explains code, including control/data flow and non-obvious behavior. It specifies the action (explain) and resource (code), and implicitly distinguishes from sibling tools like review_code or fix_code.

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

Usage Guidelines4/5

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

The description provides explicit guidance to provide exactly one of code or file_path, and suggests that think=False is usually sufficient. However, it does not explicitly state when not to use this tool versus alternatives, though the purpose alone provides some differentiation.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/darthzen/ollama-code-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server