Skip to content

decompile_assembly

Decompilation

The primary tool for reverse-engineering .NET binaries. Recovers full C# source code from compiled .dll or .exe files. Supports targeted decompilation of individual types, compilable project generation, IL output, PDB generation, and output truncation for large assemblies.

ParameterTypeRequiredDefaultDescription
assembly_pathstringYesPath to the .dll or .exe file
output_dirstring|nullNonullDirectory to save decompiled files (returns inline if omitted)
type_namestring|nullNonullFully qualified type name to decompile a single type
language_versionstringNo"Latest"C# syntax version: CSharp1CSharp12_0, Preview, Latest
create_projectboolNofalseGenerate a compilable .csproj project structure
show_il_codeboolNofalseOutput IL bytecode instead of C#
remove_dead_codeboolNofalseStrip unreachable code paths
remove_dead_storesboolNofalseStrip unused variable assignments
show_il_sequence_pointsboolNofalseInclude debug sequence points in IL (implies show_il_code)
nested_directoriesboolNofalseOrganize output in namespace-based directory hierarchy
generate_pdbboolNofalseGenerate a portable PDB file (requires output_dir)
use_pdb_variable_namesboolNofalseUse original variable names from an existing PDB
max_output_charsintNo100000Max inline characters. Excess is saved to a temp file. 0 disables truncation
{
"tool": "decompile_assembly",
"arguments": {
"assembly_path": "/path/to/MyApp.dll",
"type_name": "MyApp.Services.AuthService",
"language_version": "Latest"
}
}

Returns decompiled C# source code (or IL bytecode) as formatted text. When output_dir is provided, files are written to disk and the response confirms the output path. If the output exceeds max_output_chars, the full result is saved to a temporary file and a truncated preview is returned with recovery instructions.