Skip to main content
Glama
Heretek-RE

re-patch

by Heretek-RE

restore_original

Roll back patched files by copying the original back, with optional SHA-256 verification to ensure integrity before overwriting.

Instructions

Copy original back to restore_target, optionally verifying the original's SHA-256 against expected_sha256 first.

This is the rollback primitive. The function:

  1. Computes the SHA-256 of original.

  2. If expected_sha256 is non-empty, verifies the computed hash matches (refuses to proceed otherwise).

  3. Copies original to restore_target (overwriting).

Args: original: file whose bytes are the canonical "original" (typically the source the patch was applied from) restore_target: file to write the original bytes to (typically the patched copy) expected_sha256: optional hex-encoded SHA-256 to verify original against confirm_legal: free-text justification (audit trail)

Returns::

{
  "original": "...",
  "restore_target": "...",
  "original_sha256": "<hash>",
  "expected_sha256": "<hash>" or null,
  "verified": bool,
  "confirm_legal": "...",
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
originalYes
restore_targetYes
expected_sha256No
confirm_legalNo
Behavior4/5

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

No annotations provided, but the description fully discloses the three-step process: compute hash, optionally verify, and overwrite target. It adds behavioral context beyond schema by explaining verification logic.

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

Conciseness4/5

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

The description is well-structured with summary, numbered steps, Args, and Returns. It is slightly lengthy but every element adds value, and the action is front-loaded.

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?

In the absence of an output schema, the description provides a complete return structure. All four parameters are covered, and the use case is fully explained with step-by-step logic.

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

Parameters5/5

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

Schema description coverage is 0%, but the description includes an 'Args' block that explains the purpose of each parameter, including optionality of expected_sha256 and the audit trail role of confirm_legal.

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 clearly states the tool copies original to restore_target and calls it a rollback primitive. This distinguishes it from siblings apply_patch (forward) and check_patch/sha256_manifest (verification/list).

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?

The description identifies it as a rollback primitive, implying use for reverting patched files. It does not explicitly state when not to use or list alternatives, but context from siblings provides differentiation.

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/Heretek-RE/re-patch'

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