Skip to main content
Glama

undo_last_modification

Destructive

Roll back incorrectly generated code by restoring files to their last committed git state, or deleting untracked files. Also re-syncs the symbol index.

Instructions

Safely roll back incorrectly generated code by restoring a file to its last committed state. If the file is tracked by git, runs git checkout HEAD — this discards ALL uncommitted changes to the file, not just the most recent edit (the "last modification" name is historical). If the file is untracked (newly created), deletes it.

Also re-syncs the symbol/label index to the restored content — prefer this over a manual git revert or editor undo, which leave the index stale and (for .xml/.xpp) can desync the VS 2022 in-memory model.

⚠️ Local companion tool: available only in write-only/local mode (Windows VM).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to the file to restore to HEAD (or delete, if untracked)
Behavior5/5

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

Descriptions and annotations align: destructiveHint=true is further detailed by 'discards ALL uncommitted changes' and 'deletes it' for untracked files. The description adds extra behavioral context beyond annotations: it re-syncs the symbol/label index, an important side effect not visible from annotations, and notes the historical naming mismatch.

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 appropriately sized for a destructive tool: it front-loads the main action, clarifies the historical name, explains tracked/untracked branches, mentions index re-sync, and warns about local-only availability. Every sentence contributes useful information without redundancy.

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?

The description is thorough for a mutation tool with no output schema: it covers purpose, operational modes, side effects, alternatives, and environment restrictions. It even explains why this tool is preferred over manual methods, making it self-contained for an agent to decide when to invoke it.

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

Parameters3/5

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

Schema coverage is 100%, with filePath described as 'Absolute path to the file to restore to HEAD (or delete, if untracked).' The tool description adds little beyond this, mostly reiterating the path's purpose in different words. Baseline 3 is appropriate; there is no extra parameter-level nuance.

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: 'Safely roll back incorrectly generated code by restoring a file to its last committed state.' It also distinguishes itself from alternatives by contrasting with manual git revert and editor undo, and the name is historically explained, avoiding confusion.

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?

The description explicitly says when to use this tool over alternatives: 'prefer this over a manual git revert or editor undo, which leave the index stale.' It also clarifies the operational context (tracked vs untracked) and availability constraints (local companion tool only in write-only/local mode), giving clear usage boundaries.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dynamics365ninja/d365fo-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server