Skip to main content
Glama

Read a file from the snapshot

snapshot_read
Read-onlyIdempotent

Read a line window from one file in a repository snapshot, with secrets redacted and large sources preview-bounded, and get the next starting line when more remains.

Instructions

Return a line window of one file as the snapshot contains it: redacted, and bounded to a preview when the source is large. Reports the next fromLine when more remains.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "snapshot_read"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFile path relative to the repository root, as snapshot_locate reports it.
rootNoRepository root. Defaults to the directory this server was started in.
linesNoHow many lines to return.
outDirNoSnapshot directory, relative to the root, and it must resolve inside the served repository. Defaults to the project configuration's outDir.
fromLineNoFirst line to return, 1-based.

Output Schema

NameRequiredDescriptionDefault
partNo
pathNo
reasonNo
fromLineNo
pageableNo
totalLinesNo
nextFromLineNo
returnedLinesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the bar is lower, and the description still adds real disclosure the annotations cannot: content is redacted, large sources are truncated to a preview, and the next fromLine is reported for pagination. What is missing is any statement of what triggers the preview bound or whether truncation is silently applied.

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?

Two sentences, zero waste, and the most load-bearing facts — redaction and the preview bound — are front-loaded before the pagination note. Nothing repeats the name or title.

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?

An output schema exists, so return shape need not be spelled out, and the description correctly spends its budget on the non-obvious behaviors instead. It is nearly complete for a read tool; only the lack of guidance on snapshot-scope versus alternatives leaves a gap an agent must close by inspection.

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 100% and each of the five parameters carries its own description, including defaults and bounds, so the schema does the heavy lifting and the baseline of 3 applies. The description's only param-adjacent contribution is the pagination contract around fromLine, which is really about the return value rather than the input.

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?

The description gives a specific verb and resource ("return a line window of one file as the snapshot contains it") and states the two shaping behaviors: redaction and preview bounding. It does not name a sibling tool to contrast against, unlike the schema's mention of snapshot_locate, so it falls 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 Guidelines2/5

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

There is no when-to-use guidance at all — no statement of when to pick this over snapshot_locate, snapshot_query, or snapshot_search for reading file content. The only implied context is "as the snapshot contains it," which hints at snapshot-vs-working-tree scope but never states it as a selection rule.

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