Skip to main content
Glama

Generate the snapshot

snapshot_generate
Idempotent

Generate a budgeted repository snapshot in an output directory, replacing the previous one and returning fingerprint, part, and count details for codebase context.

Instructions

Write the snapshot to its output directory and return its fingerprint, parts and counts. Replaces the previous snapshot in that directory. A large repository can take several seconds.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "snapshot_generate"
  }
}

Input Schema

NameRequiredDescriptionDefault
onlyNoGlobs to include: replaces the config allow-list for this run.
packNoAlso write one full-repository file in this format.
rootNoRepository root. Defaults to the directory this server was started in.
sarifNoAlso write reports/audit.sarif beside reports/audit.md, for CI code scanning.
sliceNoNarrow the snapshot to what the planner picks for this question.
ignoreNoGlobs to exclude, added to the config deny-list for this run.
outDirNoSnapshot directory, relative to the root, and it must resolve inside the served repository. Defaults to the project configuration's outDir.
stagedNoOnly files staged in the git index.
skeletonNoReplace every function body with `{ /* ... */ }`, keeping signatures, imports and exports. Applies to TypeScript, JavaScript and JSX.
tokenTreeNoAlso write reports/tokens.md with per-file token estimates.
includeLogsNoAlso write reports/log.md with this many recent commits.
sliceTokensNoToken budget for `slice` (default 30000, as the CLI).
budgetTokensNoFit the snapshot into this token budget, highest value first.
changedSinceNoOnly files changed since this git ref, for example "main" or "HEAD~3".
includeDiffsNoAlso write reports/diff.md from the uncommitted diff.
maxPartBytesNoByte budget per part, for example 307200 or "300k". Defaults to the project configuration.
maxPartTokensNoToken ceiling per part, for example 32000 or "32k". Narrower than maxPartBytes; it converts at four bytes per token.
stripCommentsNoRemove comment text from JavaScript/TypeScript bodies (line numbers kept).
withDependentsNoWith staged or changedSince, also include the files that import the changed ones (one hop).
removeEmptyLinesNoDrop blank lines from emitted bodies (line numbers move; recorded per file).

Output Schema

NameRequiredDescriptionDefault
filesNo
partsNo
skippedNo
fingerprintNo
emittedBytesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Beyond the annotations, the description discloses that existing output in the directory is replaced, that a run can take several seconds on a large repository, and what the return value contains. Those are exactly the operational facts an agent needs before triggering a multi-second write, though it doesn't say whether partial writes occur on failure.

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?

Three short sentences, front-loaded with the action and its return value, then the destructive consequence, then the latency caveat. Nothing is wasted and nothing important is buried.

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?

An output schema and full annotation coverage relieve the description of explaining returns and safety, and it does add the replacement and latency notes. But for a 20-parameter tool with several mutually modifying flags, it says nothing about how those options compose or that the emitted artifact is what the downstream query tools consume, leaving a real gap in agent workflow context.

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 20 parameters carries a substantive description, so the schema does the heavy lifting and the baseline of 3 applies. The description adds no parameter meaning of its own, not even for the interacting modes (slice/sliceTokens, maxPartBytes vs maxPartTokens, staged/withDependents) where cross-parameter hints would have real value.

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 — 'Write the snapshot to its output directory' — plus the return payload (fingerprint, parts, counts), which clearly separates it from the read-only snapshot_* siblings. It stops short of naming a specific alternative, but the generate-vs-query distinction is unmistakable.

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 only implied: it is evidently the generation step that must precede the query tools, and the 'replaces the previous snapshot' note implies re-running is safe. There is no explicit when-to-use, when-not, or pointer to a sibling such as snapshot_validate or snapshot_status to check state first.

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