Skip to main content
Glama

read_chunk

Read the current, HEAD-validated source text for a chunk ID, with compact call-graph context and related repo memories, so you can inspect exact code after a search.

Instructions

Read the current source text for one chunk id, validated against HEAD (relocates or flags stale/gone), with compact call-graph context and bound repo memories. Use to read exact text after a search returns a chunk_id. When the chunk's symbol has distilled decision records they attach as distilled_records (labeled unreviewed, capped at 2).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
includeNoWhat to include: `memories` (on by default). Pass `include: []` to suppress.
chunk_idYes
worktreeNoAbsolute path of the checkout to scope reads to — pass a linked worktree to read its branch overlay. Defaults to the server's working directory. A path that is not a linked worktree of this repo is silently ignored: results then come from the indexed checkout, with no error.
graph_limitNo
include_graphNocompact
Behavior4/5

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

With no annotations, the description carries the burden of disclosing behavior. It reveals validation logic (relocates/stale/gone), the inclusion of call-graph context and memories, and the attachment of distilled decision records (labeled unreviewed, capped at 2). It does not mention side effects (though read-only is implied) or error handling specifics, but overall it provides substantial behavioral context beyond the schema.

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?

The description is three sentences, front-loaded with the primary purpose and usage. Each sentence adds distinct value: purpose, usage, and a specific behavior (distilled_records). No redundancy or fluff, though it could be slightly more compact.

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

Completeness3/5

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

For a tool with 5 parameters, no annotations, and no output schema, the description covers core behavior but gaps remain: it does not explain worktree semantics, graph_limit constraints, or how to suppress memories (though schema covers include). The description is adequate for basic usage but not fully comprehensive given the complexity.

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?

The description mentions the chunk_id and 'bound repo memories' (tied to the include parameter) and the compact call-graph context (related to include_graph), but does not explain parameters like worktree or graph_limit explicitly. Schema coverage is only 40%, so the description partially compensates but leaves several parameters under-explained. The distilled_records mention is output, not parameter semantics.

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 opens with a specific verb and resource: 'Read the current source text for one chunk id', immediately clarifying the tool's core function. It also includes validation specifics ('validated against HEAD (relocates or flags stale/gone)') and context features (call-graph, memories) that distinguish it from sibling tools like git_blame_chunk or papertrail_for_chunk.

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?

Provides an explicit usage scenario: 'Use to read exact text after a search returns a chunk_id.' This clearly indicates when to invoke the tool, though it does not explicitly mention when not to use it or point to alternative tools. The context is clear enough for straightforward selection.

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/cq27-dev/rag-rat'

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