Skip to main content
Glama

Save a Session Snapshot

save_session

Save the current session's analyzed code model as a named DB snapshot so a later session can diff against it before and after bulk changes like rename sweeps or signature migrations.

Instructions

Persist the current session's analyzed model as a named Manual snapshot in an aicb DB, so a later session can diff against it with compare_with_previous.

Use it BEFORE a bulk mechanical change (a rename sweep, a signature migration) and call compare_with_previous afterwards. An ordinary edit needs no snapshot: git diff and the tests cover it.

Returns JSON: snapshotId, sessionId, solutionId, name, lineNumbersAvailable and totalSnapshots (the snapshots that DB now holds for this solution).

It writes to the aicb DB, not to the solution's source or configuration: one new snapshot row, plus the solution's record when the DB does not know the solution yet; a DB file that does not exist is created. Nothing is overwritten: every call adds a snapshot under a fresh id, and name is a label, not a key. The snapshot keeps the line spans, but a session recalled from it reports lineNumbersAvailable false: its lines mean 'as analyzed', not the current working tree.

Parameters: sessionId is a live or recalled session's id or an absolute .sln path. Omit dbPath to use the server's standard config DB (the same one the GUI uses); when the server resolved none, the call fails with 'dbPath is required'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesHuman-readable name for this snapshot (e.g. 'before refactor').
dbPathNoOptional absolute path to the aicb SQLite DB to persist into. Omit to use the server's standard config DB.
sessionIdYesThe session_id whose current state to snapshot. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.46513
    • changedInput schema / properties / sessionId / description
      Previous value: -"The session_id whose current state to snapshot."New value: +"The session_id whose current state to snapshot. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use."
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover the safety profile (readOnlyHint=false, idempotentHint=false, destructiveHint=false), and the description goes well beyond them: it scopes the write to the aicb DB rather than source/config, enumerates the rows created, states a missing DB file is created, and stresses nothing is overwritten with name as a label not a key. It also discloses a subtle downstream behavior (lineNumbersAvailable false on recalled sessions).

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?

Front-loaded with the action, then usage, then return shape, then side effects, then parameters — a logical progression with no filler. It is on the long side for a three-parameter tool, but each paragraph carries distinct information rather than restating the schema.

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?

With no output schema, the description carries the return contract itself (snapshotId, sessionId, solutionId, name, lineNumbersAvailable, totalSnapshots) and covers the DB-write side effects and the dbPath failure mode. Nothing an agent needs to call and interpret this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: sessionId may be a live or recalled session id OR an absolute .sln path, and omitting dbPath uses the server's standard config DB with the explicit failure mode 'dbPath is required' when none was resolved. That failure-mode detail is not derivable from the schema.

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?

States a precise verb+resource+destination: 'Persist the current session's analyzed model as a named Manual snapshot in an aicb DB.' It explicitly frames the artifact against the sibling that consumes it (compare_with_previous), so an agent can place it without opening the schema.

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?

Gives an explicit trigger ('BEFORE a bulk mechanical change'), the follow-up action (call compare_with_previous afterwards), and an explicit non-trigger ('An ordinary edit needs no snapshot: git diff and the tests cover it'). This is the strongest form of when/when-not guidance.

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