Skip to main content
Glama

decomp_function

Retrieve a function's decompiled C from a specific patch binary by name or address to inspect what it does, with version-tagged Ghidra output citing version, binary, and address.

Instructions

One function's decompiled C from a patch's binary, by name (e.g. 'FUN_6fce44f0') or address ('6fce44f0' or '0x6fce44f0'; an address inside a function gives the function containing it). version and binary as for decomp_search. Up to 250 lines; says when it's truncated. This is Ghidra's decompiled output of Blizzard's own binaries (every DLL and EXE of each patch), not source code: function names are Ghidra's (FUN_, Ordinal_, thunk_...) or ours, variables are Ghidra's, and strings appear as labels like s_Data_Global_Monsters__6fb75f54 (the string's first 32 characters, punctuation as _; labelled in 1.00 to 1.10 and partly 1.14d, but hardly at all in 1.11 to 1.13d). Reading it is code reading, not testing: say what the code appears to do, not that you ran it. Cite version, binary and address (e.g. 1.09d D2Game.dll FUN_6fce44f0 @6fce44f0). In public replies quote only short snippets (a few lines), never whole functions. 1.14b and 1.14d have every DLL merged into Game.exe. For clean names use D2MOO (1.10f) or Redivivus (1.14d) first; these dumps are for other patches and for checking what a given patch's binary really does.

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": {
      "version": "<version>",
      "binary": "<binary>",
      "function_or_address": "<function_or_address>"
    },
    "name": "decomp_function"
  }
}

Input Schema

NameRequiredDescriptionDefault
binaryYes
versionYes
function_or_addressYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/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 so: it discloses the 250-line cap and truncation notice, the Ghidra-derived naming and string-label conventions (and that labels are largely absent in 1.11–1.13d), the merged Game.exe for 1.14b/1.14d, and the explicit warning that this is code reading, not execution evidence.

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?

Front-loaded with what it returns and how to address it; the naming, truncation, and citation caveats each carry operational weight. Some material (quoting policy for public replies, the parenthetical about punctuation substitution) is denser than an agent strictly needs for invocation, but nothing is redundant.

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?

An output schema exists, so return-value description is not required, and the description still covers truncation behavior and output flavor. For a three-required-parameter retrieval tool with no annotations, the caveats about naming conventions, version coverage, and merged binaries close every gap an agent would hit.

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

Parameters4/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 fully specifies function_or_address including accepted address formats ('6fce44f0', '0x6fce44f0') and interior-address behavior. Version and binary are only defined by cross-reference ('as for decomp_search') and binary values are never enumerated, leaving a gap the schema does not fill.

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 and resource ('one function's decompiled C from a patch's binary') plus the two lookup keys (name or address), which implicitly separates it from the sibling decomp_search that finds functions rather than retrieving one. An agent can tell immediately that this returns a single function body, not a list.

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 real routing guidance: use D2MOO (1.10f) or Redivivus (1.14d) first for clean names, and reserve these dumps for other patches or for verifying what a given patch's binary actually does. It also explains that an interior address resolves to the containing function. It stops short of explicitly naming decomp_search as the alternative when the function name is unknown.

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