Skip to main content
Glama

roslyn:find_unused_code

Identify unused types, methods, properties, and fields in your C# project or solution. Returns symbols with no references to help clean up dead code.

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?

Given no annotations, the description covers key behavioral traits: it returns symbols with zero references excluding declarations, includes a default limit of 50 results, and lists output fields (location, kind, accessibility). It does not mention performance implications but is otherwise transparent.

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?

Extremely concise: two sentences plus a usage line and output description. No filler, front-loaded with the core purpose. 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?

For a tool with 5 parameters, no output schema, and no annotations, the description provides adequate context: what it does, how to use it, and what it returns. It could mention handling of large results or edge cases, but is generally complete.

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 baseline is 3. The description adds value by demonstrating the projectName parameter usage and noting the default maxResults, but does not elaborate on other parameters like includePrivate or symbolKindFilter beyond their schema descriptions.

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 defines the tool's purpose: finding unused types, methods, properties, and fields in a project or solution. It specifies the scope (entire solution or specific project) and differentiates from sibling tools like find_references and find_callers by focusing on zero references.

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?

Provides explicit usage examples with and without a project name, guiding the agent on invocation. While it doesn't explicitly state when not to use it or compare to alternatives, the examples and context are sufficient for typical scenarios.

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