Skip to main content
Glama

撤销上次应用

app_undo_last_apply

Revert the last applied file changes by restoring modified or deleted originals from a backup snapshot and removing files added in that round.

Instructions

UI 专用:按备份快照精确还原修改/删除的原文件,并清理该轮新增文件。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "app_undo_last_apply"
  }
}

Input Schema

NameRequiredDescriptionDefault
backupIdNo
sourceDirNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose the destructive half of the operation (files added in that round get cleaned up) plus the mechanism (snapshot-based precise restore). It omits prerequisites/permissions, atomicity, irreversibility, and what happens when no backupId is supplied even though zero parameters are required.

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?

One sentence, front-loaded with the audience constraint (UI-only) before the mechanism, then the restore and cleanup semantics. No filler or redundant restatement of the title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive rollback tool with no annotations, no output schema, and 0% parameter documentation, the description leaves key questions open: how the backup is identified, what sourceDir scopes, whether the rollback is atomic or resumable, and what the caller observes on success or partial failure.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must define both parameters. "备份快照" indirectly implies what backupId means, but sourceDir is never explained, and with zero required parameters the default behavior when either is omitted is left entirely undefined.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Uses specific verbs (restore, clean up) against a specific resource (modified/deleted original files) via a named mechanism (backup snapshot), and the title frames it as undoing the last apply. It does not explicitly name a sibling such as app_discard_shadow or app_abort_job, so the differentiation is by mechanism rather than by routing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

"UI 专用" is a genuine when-not signal, warning that this is a UI-facing rollback rather than an agent-facing step. However, it gives no positive condition for when a rollback is appropriate (after which failed operation, with which backup) and never contrasts with alternatives like app_get_diff or app_discard_shadow.

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