Skip to main content
Glama

undo_last_modification

Destructive

Restore any file to its committed version, discarding all uncommitted edits and synchronizing the symbol/label index. Deletes untracked files as well.

Instructions

Roll back a file. Tracked by git -> git checkout HEAD, which discards ALL uncommitted changes to it, not just the last edit. Untracked -> deletes it. Also re-syncs the symbol/label index, which a manual git revert or editor undo would leave stale.

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

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?

Annotations already declare destructiveHint=true, but the description adds specific consequences: discarding ALL uncommitted changes for tracked files, deleting untracked files, and re-syncing the symbol/label index. It also discloses the side effect that a manual revert would leave stale, which is beyond the annotation's binary flag. No contradiction with annotations.

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 the core purpose in the first sentence, then immediately provides essential behavioral details in two concise sentences plus a terse note about the local companion mode. Every sentence earns its place; no filler or redundant phrasing.

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 tool's behavior depends on file tracking state, which the description fully covers. It also addresses the index re-sync side effect and the required environment (write-only/local mode), which are critical for correct usage. No output schema exists, but for a destructive rollback tool, describing output is less critical; the description covers all inputs and side effects an agent needs to invoke it safely.

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 description coverage is 100% for filePath, and the baseline for parameter semantics is 3. The description adds substantial meaning by explaining that the same filePath parameter triggers git checkout HEAD for tracked files or deletion for untracked files, which is not evident from the schema alone. This enriches the parameter's semantics meaningfully.

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 ('roll back') and resource ('a file'), with exact behavior for tracked vs untracked paths. Distinguishes itself from manual git revert and editor undo by mentioning the index sync side effect, which separates it from any sibling that might also touch files.

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?

Provides clear context about what the tool does and notes it is a local companion tool in write-only/local mode. It explains the destructive scope (all uncommitted changes, not just the last edit), which implicitly warns against misuse. However, it does not explicitly list when to prefer this over sibling tools (e.g., update_symbol_index) or when not to use it, leaving some inference to the agent.

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