decompile_method
Decompilation
Extracts a single method from a type within a .NET assembly. Decompiles the containing type, then isolates the named method from the output. Particularly useful when a type is too large to return in full, or when you only need one method’s implementation.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
assembly_path | string | Yes | — | Path to the .dll or .exe file |
type_name | string | Yes | — | Fully qualified type name (e.g., MyApp.Services.AuthService) |
method_name | string | Yes | — | Method name to extract (e.g., Validate) |
show_il_code | bool | No | true | Output IL bytecode instead of C# (more reliable for extraction) |
language_version | string | No | "Latest" | C# syntax version: CSharp1—CSharp12_0, Preview, Latest |
use_pdb_variable_names | bool | No | false | Use original variable names from an existing PDB |
Example
Section titled “Example”{ "tool": "decompile_method", "arguments": { "assembly_path": "/path/to/MyApp.dll", "type_name": "MyApp.Services.AuthService", "method_name": "ValidateToken", "show_il_code": false }}result = await client.call_tool("decompile_method", { "assembly_path": "/path/to/MyApp.dll", "type_name": "MyApp.Services.AuthService", "method_name": "ValidateToken", "show_il_code": False,})Response
Section titled “Response”Returns the extracted method body as formatted code. If multiple overloads share the same name, all matching overloads are returned with separate headings. IL mode (default) uses ECMA-335 method delimiters for reliable extraction. C# mode uses signature matching with brace-depth counting.
Related tools
Section titled “Related tools”- decompile_assembly — decompile an entire type or assembly
- search_methods — find method names by pattern before extracting
- list_types — discover fully qualified type names