Skip to main content
Glama
I-CAN-hack
by I-CAN-hack

disassemble

Mark an address or selection as code in Ghidra, returning a summary of disassembled byte ranges. Supports contiguous or non-contiguous ranges, restricted flow, and architecture-specific modes.

Instructions

Mark an address or address selection as code using Ghidra disassembly commands.

Returns a compact text summary of the disassembled byte ranges.

With a single `target`, this behaves like the GUI Disassemble action at the
current location. With `end`, `length`, or `ranges`, it behaves like
invoking Disassemble with a listing selection. `restricted=True` uses the
same restricted-set behavior as Ghidra's Disassemble (Restricted) action.

`mode="default"` chooses the normal Ghidra disassembler, except for
architecture/language combinations where a more specific default is known:
PowerPC VLE languages default to VLE, ARM Thumb-default languages default
to Thumb, and MIPS microMIPS language variants default to their alternate
ISA mode.

Architecture-specific modes are available when supported by the selected
program language:
- `thumb` or `arm` for ARM/Thumb
- `vle` or `book-e`/`ppc` for PowerPC VLE languages
- `mips16` or `mips` for MIPS16/MicroMIPS-capable languages
- `xgate` or `hcs12` for HCS12/XGATE
- `x86_32` or `x86_64` for 32-bit compatibility disassembly in x86-64

Args:
    program: Required Ghidra project path or name to target.
    target: Address, exact label, or function name. Required unless
        `ranges` is supplied.
    end: Inclusive end address for a contiguous selection.
    length: Byte length for a contiguous selection starting at `target`.
    ranges: Optional list of range objects, each with `start` plus optional
        `end` or `length`, for non-contiguous selections.
    mode: Disassembly mode. Default uses Ghidra's normal Disassemble
        command, but resolves to architecture-specific defaults for
        PowerPC VLE, ARM Thumb-default, and MIPS microMIPS languages.
        Special modes include `thumb`, `vle`, `book-e`, `mips16`,
        `xgate`, and `x86_32`.
    restricted: Restrict disassembly flow to the supplied selection/range.
    enable_analysis: Submit new instructions for incremental analysis.
    timeout: Bridge execution timeout in seconds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNo
modeNodefault
lengthNo
rangesNo
targetNo
programYes
timeoutNo
restrictedNo
enable_analysisNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly. It discloses that the tool returns a compact text summary, mimics GUI Disassemble (including the Restricted variant), details default mode resolution across languages, and explains the enable_analysis and timeout parameters. It implies mutation (marking code) without saying 'modifies the program' explicitly, but the behavior is transparent enough for an agent to infer side effects.

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 long but well-organized: an intro, a behavior paragraph, a mode list, and an Args section. Every sentence adds value, and the front-loaded purpose and GUI analogy are immediately useful. It is slightly verbose for a tool with 9 parameters, but that length is justified given the complexity of modes and selection logic.

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?

For a tool with 9 parameters, an output schema, and complex mode selection, the description covers all invocation patterns, mode defaults, restricted behavior, and return format. It even handles edge cases like non-contiguous ranges via the ranges parameter. Nothing an agent needs to call it correctly is missing, and the output schema exists for return details.

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%, so the description must explain every parameter. It does exactly that: program, target, end, length, ranges, mode, restricted, enable_analysis, and timeout are all described with their roles and constraints. The mode section even enumerates architecture-specific options with conditions. This fully compensates for the schema's lack of descriptions.

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 opens with a specific verb+resource: 'Mark an address or address selection as code using Ghidra disassembly commands.' It clearly distinguishes this from siblings like decompile or list_instructions by framing it as the GUI Disassemble action. The return value is also stated, so an agent knows what to expect.

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 clear context on how to invoke the tool: single target vs. selection via end/length/ranges, and explains the restricted flag's behavior. It does not explicitly list when to use this versus alternatives like decompile or create_function, but the GUI analogy and mode details give strong situational guidance. A dedicated 'when not to use' clause is missing, so not a perfect 5.

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