Skip to main content
Glama
drvcvt
by drvcvt

decompile_function

Decompile a binary function to pseudo-C code for static analysis, using auto-selected r2ghidra or native backend.

Instructions

Decompile a function to pseudo-C representation using the available decompiler backend.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressNoHex address of the function (e.g. "0x08048000")
backendNoDecompiler backend: "auto" tries pdg (r2ghidra) first then falls back to pdc, "pdc" uses r2 native, "pdg" uses r2ghidraauto
binary_pathYesAbsolute path to the binary file
function_nameNoName of the function to decompile (e.g. "main")

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations provided, the description carries the burden of disclosing behavior. It does add the output type and mentions backend selection, but it does not state whether the operation is read-only, whether the binary must already be analyzed, or what happens when neither address nor function_name is provided.

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?

A single front-loaded sentence that conveys the core action and output without filler. Every word earns its place, and it is appropriately compact.

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?

The description leaves important operational context unsaid: how the function is identified (address vs. function_name), whether one must be supplied, what the pseudo-C output looks like, and whether there are prerequisites like prior analysis. With no output schema or annotations, this is a significant completeness gap.

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 four parameters. The description adds little beyond the schema, but it does not need to compensate since the parameter meanings are fully covered in the input schema.

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 states a specific verb ('Decompile'), a specific resource ('a function'), and a concrete output form ('pseudo-C representation'), which clearly distinguishes this from siblings like disassemble or get_function_info. The action and output are unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The purpose implies when to use it: when a pseudo-C representation of a function is needed. However, it gives no explicit guidance on when not to use it or which sibling alternative to choose, such as disassemble, analyze_function_deep, or get_function_info.

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