Skip to main content
Glama

decompile

Read-only

Converts a binary function into readable pseudo-C, flagging checked versus lifted code and warnings to support reverse engineering.

Instructions

Decompile one function to pseudo-C. Locals are local_N/arg_N (local_N: N hex bytes below frame base, x86 entry sp-word (rbp-N after push rbp; mov rbp,rsp), arm entry sp; higher N, lower address; local_mN: N bytes above); /* asm */: unmodeled code. Header: what was checked (proved vs lift: equal to lift, 1 emulator sample), // warn: what is wrong. Use function_summary first.

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": {
      "address": "<address>"
    },
    "name": "decompile"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoReturn at most this many lines (default 300; more than the text has for all).
detailNo`skeleton` for flow and calls only; `full` or absent for all of it.
filterNoKeep only lines containing this text, case-insensitively.
offsetNoSkip this many lines of the answer.
addressYesFunction entry or any address inside it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare this a safe read (readOnlyHint=true, openWorldHint=false), so the lower bar applies, and the description still adds real substance: it explains that a header reports what was checked (proved vs lift, one emulator sample), that `// warn:` marks defects, and that `/* asm */` marks unmodeled code. That tells the agent how much to trust the output, which annotations cannot convey; it stops short of describing size/pagination behavior beyond the default 300-line limit.

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?

Purpose is front-loaded in the first sentence and every following clause carries information, with no filler. It is dense to the point of being cryptic, with heavy abbreviation and semicolon-chained asides, though nothing is genuinely redundant.

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?

With five parameters, no output schema, and an absent title, the description carries the output-interpretation burden well: it decodes local_N/arg_N numbering, unmodeled-code markers, and warning headers. It is not fully complete for a decompiler tool, since output size, fidelity caveats beyond the header, and the batch alternative are only partially addressed.

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 coverage is 100%, so the schema already documents address, limit, offset, filter, and detail, including the skeleton/full enum. The description's extra text is about output line conventions (locals, args, asm blocks), not about parameter meaning, so baseline 3 is appropriate.

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?

"Decompile one function to pseudo-C" states a specific verb (decompile), a precise scope (one function, not many), and the output format (pseudo-C). The closing "Use function_summary first" positions it relative to a named sibling, so an agent can distinguish the decompile step from the summary step without inspecting schemas.

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?

It gives a clear workflow precondition: call function_summary before this tool. What it lacks is exclusion guidance for the batch variant in the sibling list (decompile_batch) or when a single function decompile is unnecessary versus plain disassemble/function, leaving the multi-function case to inference.

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