Skip to main content
Glama
TTTTTakumi

rea_patch_server

by TTTTTakumi

rea_patch_apply

Apply byte-level patches to binary files by offset or virtual address, with wildcard matching, backups, read-back verification, and rollback on mismatch.

Instructions

打补丁(写回原文件)。

patches 每项: {"offset": "0x434 或 va0x140001234", "old": "AA??BB", "new": "909090"}

  • old 支持 ? 通配(任意字节)

  • 自动创建 .reapat_bak 备份;旧字节不匹配整批拒绝

  • 写回后逐字节回读校验,不匹配自动从备份回滚 force=true: 已有备份时仍以当前文件为基准(覆盖旧备份) dry_run=true: 只校验与预览,不写盘

Input Schema

NameRequiredDescriptionDefault
forceNo
dry_runNo
patchesYes
file_pathYes
image_baseNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations present, the description takes on the full disclosure burden and handles it well: it states that a .reapat_bak backup is created automatically, that a mismatched old-byte aborts the whole batch, that each byte is read back and verified after writing, and that a failure triggers an automatic rollback from the backup. It does not cover file locking, permissions, or the response format, which keeps it from a 5.

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 purpose is front-loaded in the first line, followed by a clear patch-record example and a short bullet list of invariants. Every line adds information an agent needs, with no restatement of the name or title.

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?

For a 5-parameter mutation tool with no annotations and no output schema, the description covers the critical behaviors (backup, atomic rejection, readback verification, rollback, preview mode) that an agent needs before invoking it. Gaps remain around image_base semantics and what the tool returns on success or partial failure.

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 0%, so the description must compensate, and it explains the patches array structure (offset/old/new), accepts 0x or va0x offsets, supports '?' byte wildcards in old, and defines the force and dry_run flags precisely. file_path and image_base remain undocumented, and image_base's interaction with va0x offsets is left unstated.

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?

The definition opens with a specific verb and resource ('打补丁(写回原文件)'), making clear that this tool writes the patched bytes back to the target file rather than verifying or restoring it. The 'write back to the original file' phrasing distinguishes it from siblings such as rea_patch_verify and rea_patch_restore, though neither sibling is named explicitly.

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?

Usage is implied through the dry_run and force flags, and the atomic-rejection semantics hint at when a preview run is warranted. However, the description never states when to reach for this tool versus rea_patch_verify or rea_patch_restore, nor does it prescribe a verify-after-apply workflow.

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