Skip to main content
Glama

Query the snapshot index

snapshot_query
Read-onlyIdempotent

Filter snapshots by layer, kind, path regex, or symbol to return matching files with part, line count, and token estimates before context or read calls.

Instructions

Filter the snapshot by layer, kind, a path regular expression or a symbol name, and return the matching files with their part, line count and token estimate. Use it to find a starting set before snapshot_context or snapshot_read. Read-only.

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_query"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNoExact kind, e.g. source, test, config.
rootNoRepository root. Defaults to the directory this server was started in.
layerNoExact layer name, e.g. src or test.
outDirNoSnapshot directory, relative to the root, and it must resolve inside the served repository. Defaults to the project configuration's outDir.
symbolNoCase-insensitive substring of an exported symbol.
maxFilesNoCap on returned files (default 40).
pathPatternNoRegular expression matched against the path.

Output Schema

NameRequiredDescriptionDefault
filesNo
matchedNo
returnedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so safety and idempotency are covered. The description repeats 'Read-only' and adds that it returns files with part, line count, and token estimate, but since an output schema exists, that return detail is redundant; it does not add further behavioral context such as pagination, error handling, or filtering limitations.

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: the first front-loads what the tool does and what it returns, the second gives usage guidance and safety. Every sentence earns its place, with no wasted or vague wording.

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

Completeness5/5

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

Given seven optional parameters, full schema description coverage, rich annotations, and an output schema, the description covers the essential purpose, filterable dimensions, return shape, usage context, and read-only nature. It need not repeat parameter details already fully documented in the schema.

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 description coverage is 100%, so the schema already explains all seven parameters. The description lists layer, kind, path regular expression, and symbol name as filter inputs, which maps to some parameters, but adds no syntax, format, or default-value details beyond what the schema provides; baseline 3 is appropriate.

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 specific verb, 'Filter', against a specific resource, 'the snapshot', and lists the filter dimensions (layer, kind, path regex, symbol). It also distinguishes the tool from siblings by naming snapshot_context and snapshot_read as downstream tools, making its role as a starting-point query clear.

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?

The description explicitly says to use it 'to find a starting set before snapshot_context or snapshot_read', which gives a clear when-to-use condition and names the alternative tools it precedes. No when-not guidance is provided, but the positive routing is sufficient to select it over those siblings.

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