Skip to main content
Glama

explain

Explains a code element by retrieving graph context and generating a prompt for an LLM to summarize its origin, behavior, or usage.

Instructions

Explain a code element using graph data — returns structured context + prompt for the LLM to summarize.

Unlike other tools that return raw data, this tool returns graph query results PLUS a natural-language prompt asking the calling LLM to explain the results to the user. The LLM uses its own reasoning to produce a human-readable summary.

No extra API calls needed — the calling model (Claude, GPT, etc.) does the summarization.

Use cases:

  • "Explain where this value comes from" → dataflow trace + summarization prompt

  • "What does this function do?" → structure + calls + prompt to describe

  • "How is this variable used?" → forward trace + prompt to explain usage patterns

The question parameter guides what graph data to fetch and how to frame the summary.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYesVariable, function, or node name to explain
fileNoFile path to narrow scope
questionNoWhat to explain: "where does this value come from?", "what does this function do?", "how is this used?" (default: general explanation)
Behavior4/5

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

Discloses that it returns graph query results plus a natural-language prompt for LLM summarization, and that no extra API call is needed. No annotations provided, so description carries burden effectively.

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?

Concise with front-loaded key points. Bullet use cases are helpful. Could be slightly tighter but no excess.

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?

Covers purpose, usage, unique behavior, and parameter details adequately. No output schema or annotations, but the description provides enough context for an agent to decide when and how to invoke.

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 coverage is 100% with clear descriptions. Description adds context: elaborates on the 'question' parameter with examples and default behavior, and explains how parameters guide data fetching.

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?

Clearly states it 'explain a code element using graph data' and distinguishes from tools that return raw data. Use cases provide concrete examples.

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?

Explicitly contrasts with other tools ('Unlike other tools...') and provides use cases, but does not directly name sibling alternatives like 'describe' or 'explain_fact'.

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/Disentinel/grafema'

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