Skip to main content
Glama

ghidra_decompile

Decompile binaries to pseudo-C with Ghidra's headless analyzer; target one function by name or address, or all functions. Requires Ghidra (set GHIDRA_HOME).

Instructions

Decompile to pseudo-C with Ghidra's headless analyzer (requires Ghidra; set GHIDRA_HOME). function: a name or address to decompile just one function; omit to decompile all (slower). Large binaries take minutes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
timeoutNo
functionNo
ghidra_homeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description must carry behavioral context, and it does disclose key traits: an external dependency/environment requirement (Ghidra, GHIDRA_HOME) and performance characteristics ('large binaries take minutes'). It omits return-format detail, but an output schema exists to cover that.

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?

Tight and front-loaded: purpose first, then the environment prerequisite, then the parameter behavior, then the perf caveat. Every clause earns its place with no filler.

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 4-parameter tool with an output schema, the description covers purpose, prerequisites, param behavior, and performance. Return values are handled by the output schema, so the only minor gap is not describing path/timeout explicitly.

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 0%, so the description must compensate. It explains 'function' well (name or address, omit for all) and implies 'ghidra_home' via the GHIDRA_HOME mention, but says nothing about 'path' or 'timeout' beyond what the schema already names.

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?

States a specific verb (decompile) and target artifact (pseudo-C), plus the mechanism (Ghidra's headless analyzer). This cleanly distinguishes it from sibling tools like disassemble or radare2, which produce assembly rather than pseudo-C.

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?

Gives prerequisites (requires Ghidra; set GHIDRA_HOME) and guidance on the function parameter (single function vs. all, noting the latter is slower). It does not explicitly name alternative tools or state when not to use it, but the context is clear.

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