decompile_type
Decompile any .NET type from a DLL or EXE to readable C# source code, automatically resolving dependencies without manual path configuration.
Instructions
Decompile a whole .NET type to C# source (with comments).
The decompiler automatically resolves dependencies from the target DLL's
own directory and the bundled lib/ folder, so asm_paths is almost
never needed for typical Unity/Godot games.
Tip: use list_types first to discover available types, then pass the
exact namespace.TypeName here.
Examples::
# Decompile an entire class
decompile_type(
dll="Backend/GameData.dll",
type_name="GameData.Domains.Character.Character",
)
# Decompile an enum
decompile_type(
dll="Backend/GameData.dll",
type_name="GameData.Domains.Combat.CombatCharacterStateType",
)Args:
dll (str): Absolute path to the assembly (.dll or .exe).
type_name (str): Fully-qualified type name, case-sensitive,
e.g. GameData.Domains.Taiwu.TaiwuDomain.
asm_paths (list[str] | None): Extra directories for dependency
resolution. The DLL's own folder and the bundled lib/ are
searched automatically, so this can almost always be None.
Only needed when a referenced assembly lives outside those paths.
Returns: DecompileResult: The decompiled C# source plus type/dll metadata.
Raises:
DllNotFoundError: dll does not exist or is not readable.
TypeNotFoundError: type_name was not found (check spelling/case).
DecompilationFailedError: Decompiler encountered an internal error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dll | Yes | ||
| type_name | Yes | ||
| asm_paths | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | ||
| type | Yes | ||
| dll | Yes |