Skip to main content
Glama

Compare with a Saved Snapshot

compare_with_previous
Read-onlyIdempotent

Diffs the current session against a saved snapshot of the same solution to show added, removed, and signature-changed types and methods; optionally restrict the diff to one type or method.

Instructions

Diff the current session against a previously saved snapshot of the SAME solution - the newest by default, or the N-th previous via snapshotsBack (0=newest saved, 1=the one before, ...). Optionally narrow the diff to a single type and/or method. Returns added/removed types plus, per changed type, added/removed methods and signature changes. Requires a sessionId and at least one earlier save_session; dbPath is optional and defaults to the server's standard config DB when omitted. Name-based, syntactic (no method-body diff). A 'note' leads the answer when the baseline was saved with the file-set hash the session still holds and the diff is empty: then it most likely compares one state with itself; with an equal hash saved by another analyzer build it says a difference can come from the analyzer.

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": "compare_with_previous"
  }
}

Input Schema

NameRequiredDescriptionDefault
dbPathNoOptional absolute path to the aicb SQLite DB holding the saved snapshots. Omit to use the server's standard config DB.
typeNameNoOptional: restrict the diff to this type (simple name, case-insensitive). Omit for the whole-solution diff. A simple name ALSO matches the namespace-qualified form the diff renders for a type whose simple name collides in the solution - then the answer spans every type of that name and 'note' says which; pass one of those qualified names to narrow to a single type. Not a substring match: 'MyApi' never matches 'MyApiExtensions'. When a filter EMPTIES a diff that did have changes, 'note' says so and names the axis that missed, because 'isIdentical: true' then describes the filtered view and not the solution. On a diff that was ALREADY empty there is no note and none is owed: 'your filter matched nothing' and 'nothing changed' are the same state there, so a typo'd name and a real one answer identically - check the spelling with find_symbol rather than reading that agreement as confirmation.
sessionIdYesThe current session_id (the 'after' side of the diff). Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use.
methodNameNoOptional: within that type, restrict to this method name (case-insensitive). Omit for all methods of the type. Same disclosure rule as typeName: if the type matched and this name matches none of its added/removed/signature-changed methods, the type is dropped from the answer and 'note' says which of the two filters came up empty - an empty view here is never evidence that the method is unchanged.
snapshotsBackNo0 = newest saved snapshot, 1 = the one before it, etc. (index into the per-solution history, newest first).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.46513
    • changedInput schema / properties / sessionId / description
      Previous value: -"The current session_id (the 'after' side of the diff)."New value: +"The current session_id (the 'after' side of the diff). Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use."
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), yet the description still adds substantive behavior: syntactic name-based comparison with no method-body diff, the exact structure of returned added/removed types and signature changes, and the conditional 'note' emitted when the baseline hash matches and the diff is empty (including the cross-analyzer-build caveat). That is real context an agent could not get from the 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?

Core operation is front-loaded in the first clause, and each sentence maps to a distinct concern (baseline selection, filtering, return shape, prerequisites, semantics, note behavior). It runs long and the 'note' discussion is dense with parentheticals, but no sentence is pure filler.

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-shape burden and does so ('added/removed types plus, per changed type, added/removed methods and signature changes'), plus the self-comparison caveat an agent needs to interpret an empty result. Nothing required for a correct call 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; the description still earns credit by explaining the snapshotsBack indexing as a history walk ('0=newest saved, 1=the one before'), the dbPath default, and the two narrowing axes together with the consequence of a filter that empties a non-empty diff. Most of this value is already duplicated in the schema property descriptions, which keeps it at 4 rather than 5.

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?

Specific verb and resource: 'Diff the current session against a previously saved snapshot of the SAME solution', with the baseline selected by snapshotsBack. It also states the diff's granularity (name-based, syntactic, no method bodies) and return shape, which clearly separates it from save_session and from change-oriented siblings like impact_of_change or evaluate_change_set.

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?

Gives a hard prerequisite ('Requires a sessionId and at least one earlier save_session') and routes one edge case to an alternative tool ('check the spelling with find_symbol'). It never states when to prefer impact_of_change or evaluate_change_set over this diff, so it stops short of full alternative routing.

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