Skip to main content
Glama

Patch Bytes

patch_bytes

Writes raw bytes to one or more addresses in an IDA Pro database, enabling targeted binary patching during reverse engineering.

Instructions

Patch bytes at address(es). Each item: {address, bytes}.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "items": "<items>"
    },
    "name": "patch_bytes"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemsYesList of {address, bytes: [int,...] or hex_string}
timeoutNoTimeout in seconds
instance_idNoREQUIRED whenever more than one database is open (from open_database's result or list_databases()); optional only while exactly one instance is live.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.1
    • changedInput schema / properties / instance_id / description
      Previous value: -"Instance id override"New value: +"REQUIRED whenever more than one database is open (from open_database's result or list_databases()); optional only while exactly one instance is live."
  2. First observedv0.9.7

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden for a mutation tool. It does not disclose whether the patch persists to the IDB, is reversible/undoable, whether analysis must be re-run afterward, or what permissions/state are required — all material for a write operation.

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?

Two short sentences with the core action front-loaded and no filler. It is lean, though the second sentence largely duplicates the schema's items description rather than adding value.

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 write tool with no annotations and no output schema, the description is thin: it omits persistence semantics, relationship to patch_asm, and any outcome/error behavior. The instance_id requirement is only captured in the schema, not reinforced in the description.

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 three parameters, including the richer 'int list or hex string' detail for bytes. The description's 'Each item: {address, bytes}' merely restates a subset of what the schema provides, adding no meaning beyond it.

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 and resource ('Patch bytes at address(es)'), so the agent knows this writes raw bytes into the binary database. However, it does not differentiate from close siblings like patch_asm (assembly-level patching) or apply_patch, leaving ambiguity about which patching tool to choose.

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?

The description provides no guidance on when to use this versus patch_asm, apply_patch, or dbg_write_mem. There are no stated prerequisites such as needing the database open or the file writable, so the agent must infer selection from tool names alone.

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