Skip to main content
Glama

roslyn:generate_equality_members

Generates Equals, GetHashCode, and equality operators for C# types. Place cursor on a class or struct declaration to create members comparing all instance fields and properties.

Instructions

Generate Equals, GetHashCode, and == / != operators for a type.

USAGE: Position cursor on a class or struct declaration. OUTPUT: Generated equality members comparing all instance fields and properties. IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to source file
lineYesZero-based line number on the type
columnYesZero-based column number
includeOperatorsNoInclude == and != operators (default: true)
previewNoPreview mode (default: true)
Behavior3/5

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

No annotations are provided, so the description discloses the key behavioral detail of zero-based coordinates. It notes the output compares all instance fields and properties. However, it does not mention any side effects (e.g., file modification) or the behavior of preview mode.

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 very concise, using short sentences and clear sections (USAGE, OUTPUT, IMPORTANT). Every sentence adds necessary information without redundancy.

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 complexity of 5 parameters and no output schema, the description adequately covers the purpose, usage coordinates, and generated output. It could mention error conditions (e.g., if not on a type declaration) but is otherwise complete.

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 100%, so parameters are documented. The description adds clarifying context about zero-based coordinates for line and column, which is crucial for correct invocation. This adds value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool generates equality members (Equals, GetHashCode, ==/!=) for a type. The verb 'Generate' and resource 'equality members' are specific. While it doesn't explicitly differentiate from sibling tools like generate_constructor, the purpose is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description advises positioning the cursor on a class or struct declaration and uses zero-based coordinates. It implies the context for use but does not explicitly state when to use this tool versus alternatives or provide exclusion criteria.

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