Skip to main content
Glama
Heretek-RE

re-patch

by Heretek-RE

apply_patch

Copy a binary file and insert base64-encoded bytes at a specified offset, returning SHA-256 hashes of both original and patched versions for audit.

Instructions

Copy src to dst, then splice new_bytes_b64 at offset.

This is the on-disk patch primitive. The original bytes at src are never modified; the patch is written to a copy at dst. The function returns both the pre-patch and post-patch SHA-256 so the analyst can record the patch's net effect in the report.

Args: src: source file (the original; never modified) dst: destination file (created or overwritten with the patched copy) offset: byte offset into dst at which to write (0-based) new_bytes_b64: base64-encoded bytes to splice in confirm_legal: free-text justification (the audit trail; the server does not enforce policy)

Returns::

{
  "src": "...",
  "dst": "...",
  "src_sha256": "<original>",
  "dst_sha256": "<patched>",
  "src_size": N,
  "dst_size": N,
  "offset": N,
  "patched_bytes": M,
  "confirm_legal": "...",
}

Override-scope contract: this tool is gated behind the run's policy override (see override-scope.md of the active run). The override authorizes on-disk patches only inside Output/<run-id>/patches/; the confirm_legal text must reference the override file and the rationale.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
srcYes
dstYes
offsetYes
new_bytes_b64Yes
confirm_legalNo
Behavior5/5

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

The description thoroughly discloses behavior: src is never modified, dst is created or overwritten, returns pre- and post-patch SHA-256, explains confirm_legal as audit trail (not enforced), and details return object keys. No annotations are present, so the description bears full responsibility and meets it.

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 sections (summary, args, returns, override-scope contract) and is front-loaded. It is slightly lengthy but every sentence adds value; minor conciseness improvements could be made.

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?

Given no annotations and no output schema, the description is remarkably complete. It covers behavior, parameter semantics, return value structure, and policy constraints (override scope). It provides all necessary information for an agent to use the tool correctly.

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?

With 0% schema description coverage, the description fully compensates by explaining each parameter: src (source file, never modified), dst (destination file, created/overwritten), offset (0-based byte offset), new_bytes_b64 (base64-encoded bytes), confirm_legal (free-text justification). This adds significant meaning beyond 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?

The description clearly states the tool's function: copy src to dst, then splice new_bytes_b64 at offset. It is identified as the 'on-disk patch primitive', which distinguishes it from sibling tools like check_patch, restore_original, and sha256_manifest.

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 provides context on when to use the tool via the 'Override-scope contract' section, explaining it is gated behind a policy override and restricted to Output/<run-id>/patches/. However, it does not explicitly state when not to use it or mention alternative approaches.

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