Skip to main content
Glama

Locate code in the snapshot

snapshot_locate
Read-onlyIdempotent

Locate the snapshot section that holds needed code by matching file paths, exported symbols, component names, or routes so only one part is read.

Instructions

Find which part holds the code you need. Matches file paths, exported symbols, component names and routes from the snapshot's index, so one part can be read instead of all of them.

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": {
      "query": "<query>"
    },
    "name": "snapshot_locate"
  }
}

Input Schema

NameRequiredDescriptionDefault
byNoRestrict what is matched. Defaults to every category.auto
rootNoRepository root. Defaults to the directory this server was started in.
limitNoMaximum matches to return.
queryYesText to match, case-insensitively, against paths and exported symbols.
outDirNoSnapshot directory, relative to the root, and it must resolve inside the served repository. Defaults to the project configuration's outDir.

Output Schema

NameRequiredDescriptionDefault
totalNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds one genuinely useful behavioral fact, that matching runs against the snapshot's index rather than live files or source content. It says nothing about stale or missing snapshots, result ranking, or how truncation by limit is signalled, so the bar for extra context is only partly met.

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?

Two compact sentences with the payoff stated first and the mechanism second; there is no filler or restatement of the tool name. Slightly more precision (one concrete example query form, or a pointer to the follow-up read tool) would justify a 5.

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?

The tool is simple, has only five parameters, full schema coverage and an output schema, so the description need not explain return values. However, in a catalog containing snapshot_search, snapshot_query, snapshot_symbol, snapshot_routes and snapshot_read, an agent still lacks the cue that separates locating from searching or reading, and lacks any prerequisite note about the snapshot index.

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 baseline is 3. The description adds slight meaning by naming match categories (paths, symbols, component names, routes), but it does not map these onto the 'by' enum values (auto, path, symbol, route, layer, kind) and is silent on layer/kind, and it never mentions root, limit or outDir. The schema remains the primary source of parameter meaning.

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 ('Find which part holds the code you need') and enumerates what is matched: file paths, exported symbols, component names and routes. That is materially clearer than the name alone. It does not explicitly distinguish itself from close siblings such as snapshot_search, snapshot_query or snapshot_symbol, so it stops 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 Guidelines3/5

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

Usage is implied through the stated payoff: locate first so 'one part can be read instead of all of them', which sketches a locate-then-read workflow. There is no explicit when-to-use versus a named alternative, no exclusion, and no note that a snapshot must already exist before this index lookup is meaningful.

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