Skip to main content
Glama

create_repository_snapshot

Idempotent

Generate a content-hashed, immutable snapshot of a saved repository for triage and graph queries; reuses existing snapshots on identical inputs and never modifies the repository.

Instructions

Create or reuse an immutable, content-hashed snapshot of a saved repository connector (a connector of a repository type — find its id with list_connectors). Re-running with identical inputs returns the existing snapshot (status='existing') instead of duplicating it. The snapshot is the input to triage_repository and query_repository_graph; every later stage references it by snapshot_id. Reads the repository and persists snapshot, symbol, and dependency graph artifacts; it never writes to the repository. Returns snapshot_id, resolved_revision, content_hash, file_count, language_counts, and artifact refs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoGit ref to snapshot; defaults to the connector's default ref.
max_filesNoFile-count cap, up to 200000; defaults to 20000.
repository_idYesSaved repository connector id from list_connectors.
exclude_patternsNoGlob patterns excluding files from the snapshot.
include_patternsNoGlob patterns limiting which files are snapshotted.
max_file_size_bytesNoPer-file size cap in bytes, 1024-10000000; defaults to 1000000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.1.3
    • addedInput schema / properties / exclude_patterns / description
      Added value: +"Glob patterns excluding files from the snapshot."
    • addedInput schema / properties / include_patterns / description
      Added value: +"Glob patterns limiting which files are snapshotted."
    • addedInput schema / properties / max_file_size_bytes / description
      Added value: +"Per-file size cap in bytes, 1024-10000000; defaults to 1000000."
    • addedInput schema / properties / max_files / description
      Added value: +"File-count cap, up to 200000; defaults to 20000."
    • addedInput schema / properties / ref / description
      Added value: +"Git ref to snapshot; defaults to the connector's default ref."
    • addedInput schema / properties / repository_id / description
      Added value: +"Saved repository connector id from list_connectors."
  2. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare idempotentHint=true, destructiveHint=false, openWorldHint=true, and readOnlyHint=false. The description adds valuable context: it reads the repository and persists snapshot, symbol, and dependency graph artifacts, while never writing to the repository. It also discloses the idempotent reuse with status='existing'. This exceeds what annotations alone convey, providing the agent with a clear understanding of side effects and safety. No contradiction with annotations.

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?

The description is a single paragraph with multiple sentences, each serving a purpose: stating the core function, idempotent behavior, downstream usage, side effects, and return fields. It is front-loaded with the primary action. It's slightly verbose but not wasteful, and the structure is logical. It earns a 4 for being informative without excessive fluff.

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?

The tool is moderately complex with 6 parameters and no output schema. The description covers the key contextual elements: what the snapshot is, how it's used downstream, the idempotent reuse behavior, side effects (persisting artifacts, not writing to the repo), and the return fields (snapshot_id, resolved_revision, content_hash, file_count, language_counts, artifact refs). It lacks details like auth requirements or potential error conditions, but given the annotations and schema, it is adequately complete for an agent to call it correctly.

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 all six parameters are documented in the schema. The description adds minimal parameter-specific meaning beyond the schema, only clarifying that repository_id comes from list_connectors. It does mention the content-hashed nature of the snapshot, which relates to the output, but not to individual parameters. Given full schema coverage, a baseline of 3 is appropriate; the description doesn't significantly augment parameter understanding.

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 clearly states the tool creates or reuses an immutable content-hashed snapshot of a repository connector, and it distinguishes this from related tools like get_repository_snapshot by emphasizing the create/reuse behavior and its role as input to triage_repository and query_repository_graph. The reference to list_connectors for finding the id adds clarity. It could be more explicit about the distinction from get_repository_snapshot, but the purpose is clear.

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

Usage Guidelines4/5

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

The description explains when to use the tool: as the entry point for snapshotting before triage/query, and that re-running with identical inputs returns the existing snapshot (idempotent reuse). It implicitly suggests that once you have a snapshot_id, you might use get_repository_snapshot, but it doesn't explicitly state that alternative. The guidance is clear on the idempotent behavior and the downstream dependency, which is sufficient for an agent.

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

Deploy Server

Other Tools