Skip to main content
Glama

decompile_type

Decompile a .NET class to C# source code by providing the assembly path and fully-qualified type name. Returns decompiled code or an error on failure.

Instructions

Decompile a single class to C# via ilspycmd.

Args: path: path to a .dll / .exe .NET assembly fqn: fully-qualified type name (e.g. MyGame.PlayerController). Discover candidates with :func:parse_assembly first.

Returns::

{"path": "...", "fqn": "...", "code": "C# source..."}

On decompiler failure (e.g. an obfuscated control-flow pattern ilspycmd refuses to lift, or ilspycmd not installed), returns code: null and a non-null error field. ilspycmd is the industry-standard CLI for ILSpy; for protected binaries the next step is re-decompile (which calls into de4dot for unpacking) before re-running this tool.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
fqnYes
Behavior4/5

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

Since no annotations are present, the description carries full burden. It discloses success/failure behavior: returns code on success, or 'code: null' with a non-null 'error' field on failure. It also explains possible failure causes (obfuscated patterns, missing ilspycmd). Side effects are unlikely and not mentioned, which is fine for a read-only decompilation tool.

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?

The description is concise and well-structured: a opening sentence defines the purpose, followed by Args and Returns sections, then notes on failure handling and next steps. It front-loads the purpose and avoids unnecessary details. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (2 parameters, no output schema, no annotations), the description covers essential aspects: purpose, parameters, return format, failure modes, and workflow (parse_assembly first, re-decompile if needed). It lacks explicit error field name in the example, but the text clarifies. Overall, it equips an AI agent adequately.

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 coverage is 0%, but the description provides meaningful parameter semantics: 'path' is described as a path to a .dll/.exe .NET assembly, and 'fqn' is explained with an example (MyGame.PlayerController) and guidance to discover candidates via parse_assembly. This adds significant value beyond the schema's bare titles.

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 clearly states the tool's purpose: 'Decompile a single class to C# via ilspycmd.' It uses a specific verb (decompile) and resource (single class), differentiating it from related sibling tools like decompile_method (for methods) and parse_assembly (for discovery).

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?

The description instructs users to discover candidates with parse_assembly first and notes that on failure (e.g., obfuscation), the next step is 're-decompile' for unpacking. This provides clear context and a workflow, but does not explicitly distinguish from other alternatives like decompile_method in terms of when to use which.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Heretek-RE/re-dotnet'

If you have feedback or need assistance with the MCP directory API, please join our Discord server