Skip to main content
Glama

Check an Edit Before Writing It

evaluate_change_set
Read-onlyIdempotent

Preview code-quality, design-smell and layer-violation findings a proposed edit would introduce, in memory, before writing it. Returns pass, warn or block from the session baseline.

Instructions

Advisory policy gate: which code-quality / design-smell / layer-violation findings would this edit INTRODUCE? Ask BEFORE writing it. Cheapest form - the edit you are about to make anyway: changes: [{filePath, oldText, newText}], the snippet being replaced and what it becomes (the shape an editor takes). The full file is rebuilt here from the analyzed document, so the payload is the size of the CHANGE, not of the file, and 'operation' defaults to 'modify'. oldText must occur EXACTLY ONCE - a missing or ambiguous anchor is an error, never a silently different edit; line endings are reconciled for you; an empty newText deletes the snippet. Full-text form still works and is required for add/delete: {filePath, operation: 'modify'|'add'|'delete', newContent}. Findings are a delta against the current session, so pre-existing debt is never blamed. The changeset is applied as an in-memory Roslyn overlay (NO disk write, the session is untouched) and the amended solution is re-analyzed. Verdict: pass / warn / block. Policy: 'block_on_critical' (default) | 'block_on_warning' | 'advisory' (an unknown policy is rejected, not silently treated as advisory). Advisory only - an MCP tool cannot block; the real blocking gate is the CLI '--fail-on'. The findings delta honors the session's explicit layer profile (analyze_solution(layerProfile) / sidecar) and its resolved test-detection profile on both sides; pass dbPath to also use that DB's active QualityProfile (producer thresholds + toggles) and its configured default layer profile (per-solution > app-global; the explicit session profile still wins) - same semantics as list_insights, so the gate judges by the same configured thresholds as the CLI gate. apply_change_set is out of scope. Pass absolute file paths matching the analyzed documents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dbPathNoOptional path to an AIContextBuilder SQLite DB. When set, producer thresholds + toggles come from that DB's active QualityProfile AND its configured default layer profile (per-solution > app-global) drives the layer-violation analysis on BOTH delta sides (an explicit analyze_solution(layerProfile) wins); omit to fall back to the server's default config DB (the GUI's, if the server resolved one), else the default profile + session axes, and the layer profile to the config DB the session was analysed against - the one its renders read.
policyNoPolicy: 'block_on_critical' (default) | 'block_on_warning' | 'advisory'.
changesYesThe proposed file changes. Per change: filePath (absolute), plus EITHER the anchor patch oldText + newText (preferred - 'operation' may be omitted, it defaults to 'modify') OR the full new file text newContent with operation 'modify'/'add' ('delete' takes neither).
sessionIdYesThe session_id returned by analyze_solution (the baseline). 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.46514
    • changedInput schema / properties / dbPath / description
      Previous value: -"Optional path to an AIContextBuilder SQLite DB. When set, producer thresholds + toggles come from that DB's active QualityProfile AND its configured default layer profile (per-solution > app-global) drives the layer-violation analysis on BOTH delta sides (an explicit analyze_solution(layerProfile) wins); omit to fall back to the server's default config DB (the GUI's, if the server resolved one), else the default profile + session axes."New value: +"Optional path to an AIContextBuilder SQLite DB. When set, producer thresholds + toggles come from that DB's active QualityProfile AND its configured default layer profile (per-solution > app-global) drives the layer-violation analysis on BOTH delta sides (an explicit analyze_solution(layerProfile) wins); omit to fall back to the server's default config DB (the GUI's, if the server resolved one), else the default profile + session axes, and the layer profile to the config DB the session was analysed against - the one its renders read."
  2. Changed1 schema field changedv0.5.46513
    • changedInput schema / properties / sessionId / description
      Previous value: -"The session_id returned by analyze_solution (the baseline)."New value: +"The session_id returned by analyze_solution (the baseline). Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use."
  3. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Far exceeds the annotations: states the changeset is applied as an in-memory Roslyn overlay with NO disk write and the session untouched, that the gate is advisory only because an MCP tool cannot block (real gate is CLI --fail-on), that oldText must occur exactly once or it is an error, and how layer/quality profiles are resolved on both delta sides.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded and most sentences carry non-redundant behavioral detail, but the prose is extremely dense and long for a four-parameter tool, packing profile-resolution and precedence caveats into a single flowing paragraph that is hard to scan.

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, yet the description covers the verdict shape (pass/warn/block), the delta-vs-session finding semantics, the available policy values, and the advisory-only caveat, so an agent has everything needed to call and interpret it.

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: the oldText/newText anchor-patch shape, operation defaulting to 'modify', empty newText deleting, and precisely what dbPath changes (QualityProfile thresholds + default layer profile with precedence rules).

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 specific verb+resource ('which findings would this edit INTRODUCE') with a clear noun: an advisory policy gate over a proposed change set. It also proactively rules out the confusingly-named sibling by declaring 'apply_change_set is out of scope', so an agent can separate the preview from the write.

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?

Explicitly says to ask BEFORE writing, names the cheapest form (anchor patch) versus the full-text form required for add/delete, and rules out apply_change_set. It stops short of naming which sibling to use instead for the adjacent 'what will my change impact' question, so selection against impact_of_change/review_context is left implicit.

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