Skip to main content
Glama
Treeweft

treeweft-mcp

Official
by Treeweft

explain_code

Explain a specific code concept or section by searching with a focused query and optional file filter, returning tight context.

Instructions

Use when the user asks you to explain a specific concept or section of code and wants tight, focused context (e.g. 'explain how X works' rather than 'find everything about X'). Same as search_code but with top_k=5 and an optional file_path filter applied server-side — useful for narrowing to a single file you already know is relevant.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
languageNo
use_hydeNo
file_pathNo
source_idNo
cross_repoNo
use_hybridNo
path_prefixNo
rerank_poolNo
use_graph_scoringNo
use_summary_vectorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2026.9.23

TDQS

A4.1/5.0
Behavior4/5

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

No annotations are provided, so the description carries the burden. It discloses key behavioral traits: top_k=5, optional file_path filter applied server-side, and that it returns focused context. However, it does not describe the output format or any side effects, which is a minor gap but not misleading.

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 two sentences, front-loaded with usage context and key differentiators. Every word earns its place, and it avoids unnecessary detail while conveying the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (11 parameters, no output schema, no annotations), the description is incomplete. It does not explain what the tool returns, how to use most parameters, or any limitations beyond the top_k and file_path filters. An agent would struggle to use this tool effectively with only this description.

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

Parameters2/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 only mentions top_k (implicitly) and file_path, leaving 9 other parameters (language, use_hyde, cross_repo, etc.) unexplained. This is insufficient for a tool with 11 parameters, as the agent has no guidance on how to set them.

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 states a clear purpose: explaining a specific concept or section of code with tight, focused context. It explicitly contrasts with search_code, saying it is the same but with top_k=5 and an optional file_path filter, which distinguishes it from siblings and clarifies its role.

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

Usage Guidelines5/5

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

Provides explicit when-to-use guidance: use when the user wants a focused explanation (e.g., 'explain how X works') rather than broad search. It names the alternative (search_code) and highlights the differences, giving the agent a clear routing decision.

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