Skip to main content
Glama

roslyn:generate_equality_members

Automatically generate Equals, GetHashCode, and equality operators for C# classes and structs by analyzing 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?

With no annotations provided, the description carries the full burden. It describes what gets generated ('equality members comparing all instance fields and properties') and the coordinate system, but doesn't mention potential side effects, error conditions, or what happens in preview mode. It adds useful context but lacks comprehensive behavioral disclosure.

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 with clear sections (purpose, usage, output, important note), uses bullet-like formatting, and every sentence earns its place by providing essential information without any wasted words.

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 code generation tool with 5 parameters and no output schema, the description provides good context about what gets generated and how to use it. However, without annotations or output schema, it could benefit from more information about the generated code format or error handling to be fully 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 the schema already documents all 5 parameters thoroughly. The description adds minimal parameter-specific information beyond the schema, mainly emphasizing the zero-based coordinate system which is already in the schema descriptions. Baseline 3 is appropriate 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 specific action ('Generate Equals, GetHashCode, and == / != operators') and the target resource ('for a type'), distinguishing it from siblings like 'generate_constructor' or 'implement_missing_members' which serve different code generation purposes.

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

Usage Guidelines5/5

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

It explicitly states when to use it ('Position cursor on a class or struct declaration') and provides important contextual constraints ('Uses ZERO-BASED coordinates'), giving clear operational guidance that helps distinguish it from other code generation tools.

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