Skip to main content
Glama

decompile

Lift a single function from machine code into readable pseudo-C, rebuilding control flow, naming arguments and locals, and resolving imports and strings.

Instructions

Lift one function to readable pseudo-C.

Control flow is rebuilt from the basic-block graph: dominators, natural loops and if/else joins become while / if statements instead of goto, cmp + jcc pairs become conditions, arg0..arg3 name the incoming register arguments, imports and string references are resolved through the image, and registers that hold rbp-relative slots become locals. Every line keeps the original instruction as a trailing comment, so the output can be checked against disassemble instead of trusted.

Heuristics are stated in the response: confidence drops when blocks are unreachable, the graph is irreducible, or instructions stay unmodelled (SSE, string ops), and notes says why. Pair with rename_function — the annotated name is used by later calls.

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

Input Schema

NameRequiredDescriptionDefault
vaYes
keyYes
sessionNo
max_blocksNo
include_commentsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does substantial work: it explains how control flow is reconstructed, that every line retains the original instruction as a trailing comment, that `confidence` drops on unreachable blocks, irreducible graphs, or unmodelled instructions (SSE, string ops), and that `notes` explains why. It does not state that the operation is read-only or mention error conditions, which are the remaining gaps for a mutation-free analysis tool.

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 purpose is front-loaded in the first sentence and the remaining detail is dense and specific rather than padded. The algorithm narrative (dominators, natural loops, `cmp` + `jcc`) is somewhat long, but it earns its place by telling the agent what the output will look like and why it may be wrong.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained, and the description still adds useful semantics about `confidence` and `notes`. However, for a five-parameter tool with zero schema description coverage, leaving four parameters undefined is a real completeness gap that the rich prose does not close.

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

Parameters2/5

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

Schema description coverage is 0% across five parameters, so the description must compensate and largely does not. It never explains `key`, `va`, `session`, or `max_blocks`; only `include_comments` is indirectly implied by the sentence about trailing instruction comments, and `max_blocks` can be guessed from context but is never tied to the parameter.

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 and resource: "Lift one function to readable pseudo-C." It states the scope (one function) and the output form (pseudo-C), which is immediately distinguishable from the sibling `disassemble`, and it reinforces the distinction later by telling the agent to check output against `disassemble`.

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 clear context for use: lift a single function, cross-check with `disassemble` rather than trusting the result, and pair with `rename_function` so the annotated name propagates. It stops short of explicit when-not-to-use guidance (e.g. for large or irreducible functions), so it is strong but not complete.

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