Skip to main content
Glama
This server has been deprecated

Rebranded to ComposeLint AI. Repository has been moved to TechsOneAi/ComposeLintAI.

rollback_pattern

Destructive

Reverts all file changes made by a specific pattern replacement call, using its pattern_id to restore affected files byte-for-byte when a replacement causes UI regressions or compile issues.

Instructions

Rolls back ALL changes made by a specific replace_pattern call.

When to use:
- Call when a pattern replacement resulted in unexpected UI behavior or compilation issues.
- Call to safely undo all file changes associated with a pattern_id.

When NOT to use:
- Do not use to revert single token edits (use rollback_last or reject_change instead).
- Do not use without a valid pattern_id from list_applied_patterns.

Side effects:
- DESTRUCTIVE: Modifies source files on disk to restore their pre-replacement states.


What it does: Requires pattern_id from the original replace_pattern response. All files are reverted byte-for-byte.
When to use: When a replace_pattern operation caused regressions and needs complete reversal.
When NOT to use: Cannot undo if files were modified externally. Use rollback_last for single-edit undo.
Side effects: Destructive rollback. Modifies all files touched by the pattern back to their prior state.
Parameters:
  - pattern_id: The exact pattern_id from the original replace_pattern response.
Returns:
  JSON string with list of reverted files and status.

Input Schema

NameRequiredDescriptionDefault
pattern_idYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added
  2. Removed
  3. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the safety profile is known, but the description adds real context: files are reverted byte-for-byte to pre-replacement state, and the rollback cannot succeed if files were modified externally. It also names the provenance requirement (pattern_id from the original replace_pattern response). It does not mention partial-failure behavior or whether the rollback is atomic across files.

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

Conciseness2/5

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

The same content is delivered twice: a structured block (What it does / When to use / When NOT to use / Side effects) followed by a near-identical prose repetition of every one of those points. Roughly half the text is redundant, which inflates length without adding information and risks the agent treating the duplicate lines as distinct constraints.

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

Completeness4/5

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

Covers purpose, usage, prerequisites, destructive side effects, and the parameter source, which is everything an agent needs to invoke it correctly; an output schema exists so return details need not be spelled out (the description restates them anyway). Minor gap: no guidance on what state the workspace is left in if only some files can be reverted.

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 0% and the single parameter has no schema description, so the description must carry the burden — and it does, specifying that pattern_id must be the exact value returned by the original replace_pattern response. That provenance detail is meaningfully beyond the bare 'string' type in the schema.

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 (rolls back) and a specific resource scope (ALL changes made by a specific replace_pattern call), including the 'ALL' quantifier that separates it from single-edit undo. An agent can distinguish it from rollback_last and reject_change without opening any schema.

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?

Provides explicit 'When to use' (unexpected UI behavior, compilation issues, undoing by pattern_id) and 'When NOT to use' (single token edits -> rollback_last or reject_change; no valid pattern_id -> list_applied_patterns) sections. Alternatives and the condition selecting each are named outright.

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