Skip to main content
Glama

roslyn:find_unused_code

Identify unused types, methods, properties, and fields in .NET/C# projects to remove dead code and improve maintainability.

Instructions

Find unused types, methods, properties, and fields in a project or entire solution. Returns symbols with zero references (excluding their declaration).

USAGE: find_unused_code() for entire solution, or find_unused_code(projectName="MyProject") for specific project. OUTPUT: List of unused symbols with location, kind, and accessibility. Default limit: 50 results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNameNoOptional: analyze specific project by name, omit to analyze entire solution
includePrivateNoInclude private members (default: true)
includeInternalNoInclude internal members (default: false - usually want to keep internal APIs)
symbolKindFilterNoOptional: filter by symbol kind (Class, Method, Property, Field)
maxResultsNoMaximum results to return (default: 50, helps manage large outputs)
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure and does so effectively. It explains what gets returned ('List of unused symbols with location, kind, and accessibility'), mentions a default limit ('Default limit: 50 results'), and clarifies the analysis scope ('excluding their declaration'). This provides good behavioral context for a read-only analysis tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is perfectly structured and concise: purpose statement, usage guidance, and output details in three clear sections. Every sentence earns its place with no wasted words, and the most critical information (what the tool does) is front-loaded.

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?

For a read-only analysis tool with 5 parameters (100% schema coverage) but no output schema, the description is largely complete. It explains the tool's purpose, usage, and output format well. The only minor gap is that it doesn't explicitly state this is a safe, non-destructive operation (though implied by 'Find'), which would be helpful given no annotations.

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

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description adds minimal value beyond the schema—it only mentions the 'projectName' parameter in the USAGE section and implies 'maxResults' via 'Default limit: 50'. This meets the baseline of 3 when the schema does the heavy lifting.

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 with specific verb ('Find') and resources ('unused types, methods, properties, and fields in a project or entire solution'), and distinguishes it from siblings like 'find_references' or 'find_callers' by focusing on unused rather than used symbols. The first sentence is a complete, unambiguous statement of what the tool does.

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 USAGE section provides explicit guidance on when to use the tool with different parameter configurations (entire solution vs. specific project), which helps the agent understand context. However, it doesn't mention when NOT to use it or explicitly compare it to alternatives like 'find_references' for finding used symbols, which prevents a perfect score.

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/pzalutski-pixel/sharplens-mcp'

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