Skip to main content
Glama

Context for a set of changed files

snapshot_diff_context
Read-onlyIdempotent

Returns each changed file's head window and the files that import it within a token budget, so reviewers can see missed dependents.

Instructions

Given the paths a change touched, return each one head window plus the files that import it, within a token budget. The dependents are what a reviewer usually misses. Read-only.

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": {
      "paths": "<paths>"
    },
    "name": "snapshot_diff_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootNoRepository root. Defaults to the directory this server was started in.
pathsYesChanged paths, as the manifest names them.
outDirNoSnapshot directory, relative to the root, and it must resolve inside the served repository. Defaults to the project configuration's outDir.
maxTokensNoBudget for the block (default 15000).
linesPerFileNoHead lines per changed file (default 80).

Output Schema

NameRequiredDescriptionDefault
changedNo
missingNo
dependentsNo
usedTokensNo
budgetTokensNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive, and closed-world, so 'Read-only.' adds nothing. The description does contribute real behavior beyond annotations: output volume is governed by a token budget and each path expands into a head window plus importer files, which tells the agent to expect a bounded, expanded rather than raw result. It does not disclose what happens when the budget or line limits are hit.

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?

Three tight sentences, front-loaded with the core behavior and its payoff, with no padding. The trailing 'Read-only.' is the only wasted sentence since annotations already cover it.

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 does not need explaining, and all five parameters are fully documented in the schema. The description covers scope, expansion behavior, and budget. The only gap is unclear truncation or overflow behavior when the token budget is exceeded.

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%, so baseline is 3. The description reinforces the meaning of 'paths' as the paths a change touched and flags that the budget bounds the block, but it adds no syntax, format, or default detail beyond what the schema already documents for root, outDir, maxTokens, and linesPerFile.

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 names a specific verb and a two-part resource: it returns each changed path's head window plus the files that import it, subject to a token budget. That is concrete and distinguishable from a generic context fetch. It stops short of naming a sibling such as snapshot_dependents or snapshot_context, so the agent must infer the boundary from names alone.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: 'The dependents are what a reviewer usually misses' signals a code-review preparation scenario, which is helpful framing. However, there is no explicit when-to-use, when-not-to-use, or pointer to an alternative tool for a different need, leaving selection among the many siblings to inference.

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