Skip to main content
Glama

Save a Session Snapshot

save_session

Persist the current session's analyzed model as a named aicb DB snapshot before bulk changes, enabling a later diff via compare_with_previous.

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/.slnx/.slnf 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'.

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": {
      "sessionId": "<sessionId>",
      "name": "<name>"
    },
    "name": "save_session"
  }
}

Input 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

A5/5.0
Behavior5/5

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

Beyond annotations, the description discloses the write target: the aicb DB, not source or configuration. It explains exactly what is added, that a missing DB file is created, that nothing is overwritten, that every call adds a fresh snapshot id, that name is a label rather than a key, and that recalled snapshots report lineNumbersAvailable false.

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 front-loaded with purpose and usage, then return values, write behavior, and parameter nuances. Although detailed, every sentence carries operational information for a stateful snapshot tool.

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?

There is no output schema, but the description lists the JSON return fields and explains the persistence semantics. For a non-idempotent DB-writing tool, the description is complete enough for an agent to decide when and how to call it.

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

Parameters5/5

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

Schema coverage is already 100%, but the description still adds useful meaning: sessionId may be a live or recalled session id or an absolute solution path, and omitting dbPath uses the server's standard config DB unless none was resolved, in which case the call fails with 'dbPath is required'.

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 and resource: persist the current session's analyzed model as a named Manual snapshot in an aicb DB. It also names the sibling tool used afterward, compare_with_previous, so the agent can distinguish this from diff/compare tools.

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?

It explicitly says to use this before a bulk mechanical change and call compare_with_previous afterwards. It also states that ordinary edits need no snapshot because git diff and tests cover them, giving a clear when-not-to-use condition.

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