Skip to main content
Glama

Stage Code Action

stage-code-action
Destructive

Stage a selected C# code fix, refactoring, or prepared Fix All in the active transaction without writing source files, using the supplied action ID and matching snapshot.

Instructions

Revalidates and stages one selected Code Fix, refactoring or prepared Fix All operation in the active transaction without writing source files. Start the transaction before discovery or preparation, then supply the actionId from list-code-actions or the new prepared ID from prepare-fix-all with its matching expectedSnapshot. Prepared Fix All staging must match the exact prepared change set and document limit. Successful staging consumes the reference; use the returned snapshot and rediscover before selecting another action. Inspect transaction-preview, or transaction-review in approval-required mode, then transaction-commit to write files or transaction-rollback to discard staged work.

Input Schema

NameRequiredDescriptionDefault
actionIdYesThe opaque action reference.
workspaceNoProvide workspaceId, alias, path, or any combination.
expectedSnapshotYesEcho the snapshot returned with the data or transaction state used to construct this request.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.0.6

TDQS

A4.7/5.0
Behavior4/5

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

Beyond annotations, the description discloses that staging does not write source files, successful staging consumes the action reference, and the returned snapshot must be used before selecting another action. It also states that prepared Fix All staging must match the exact prepared change set and document limit. It does not cover failure modes or authorization requirements, but the annotations already carry the safety profile.

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 action is front-loaded in the first sentence, followed by transactional sequencing and constraints. Despite covering a complex workflow, every sentence provides operational guidance and there is no obvious 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?

Given annotations, a nested input schema, and an output schema, the description is complete enough for correct invocation. It explains the transaction lifecycle context, actionId sourcing, snapshot matching, and next-step alternatives without needing to restate return-value details.

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 parameters are already well documented. The description adds useful meaning by explaining that actionId comes from list-code-actions or prepare-fix-all and that expectedSnapshot must match the state used to construct the request, including the prepared change set and document limit for Fix All.

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 gives a specific verb and resource: it revalidates and stages a selected Code Fix, refactoring, or prepared Fix All operation in the active transaction. It clearly distinguishes this staging step from discovery via list-code-actions, preparation via prepare-fix-all, and later transaction-preview/commit/rollback actions.

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 start the transaction before discovery or preparation, where to get actionId, and how to use prepare-fix-all output with the matching expectedSnapshot. It also names the correct inspection and completion alternatives: transaction-preview or transaction-review, then transaction-commit or transaction-rollback.

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