Skip to main content
Glama

hex_replace

Replace bytes at a specific file offset or swap a hex pattern throughout a binary. Patch game files by overwriting bytes with same-length replacements.

Instructions

Replace bytes at a specific offset or replace a pattern throughout the file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
offsetNoSpecific offset to replace at (if provided, ignores search_hex)
file_pathYesPath to the file
search_hexNoHex pattern to find
replace_hexYesHex pattern to replace with (must be same length)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.4

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden for a mutation tool. It never states that the file is modified in place, whether a backup is made, whether changes are reversible, what permissions are needed, or what happens on a pattern mismatch or length mismatch — significant gaps for a destructive write.

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?

A single well-formed sentence with the two modes front-loaded and no filler. It is appropriately sized, though the absence of any operational caveat means it is lean to the point of under-informing.

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 mutation tool with no annotations and no output schema, the description is too thin. It omits in-place editing semantics, error behavior, and the consequences of pattern vs. offset mode, leaving an agent without enough context to invoke it safely.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents all four parameters including the offset-overrides-search_hex precedence and the equal-length constraint. The description adds only the idea that search mode acts 'throughout the file' (all occurrences), a small increment over the schema baseline.

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?

States a specific verb (replace) and resource (bytes/hex) and distinguishes its two operating modes: offset-targeted vs. pattern-wide. It does not, however, differentiate itself from closely related siblings like hex_write, hex_search, or jar_hex_edit, so 4 rather than 5.

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

Usage Guidelines2/5

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

No when-to-use guidance, no prerequisites, and no mention of alternatives. The agent must infer from the description alone that offset mode and search mode are mutually exclusive; nothing routes it between this tool and hex_write or pattern_scan.

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

Deploy Server

Other Tools