Skip to main content
Glama

roslyn:check_type_compatibility

Verify type compatibility for safe assignments and casts in C#/.NET code by checking if one type can be assigned to another, providing compatibility status and conversion details.

Instructions

Check if one type can be assigned to another. Use before generating assignments or casts.

USAGE: check_type_compatibility(sourceType="MyDerivedClass", targetType="MyBaseClass") OUTPUT: compatible (bool), requiresCast (bool), conversionKind, and explanation of why/why not.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceTypeYesThe source type name (e.g., 'MyDerivedClass')
targetTypeYesThe target type name (e.g., 'MyBaseClass')
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It describes the tool's behavior (checking type compatibility) and output structure (compatible, requiresCast, conversionKind, explanation), which is helpful. However, it doesn't mention potential limitations (e.g., language version constraints, accessibility rules) or error conditions that could affect behavior.

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 efficiently structured with three sentences: purpose statement, usage guidance, and output explanation. Every sentence adds value without redundancy, and the information is front-loaded with the core purpose stated first.

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 2 parameters, 100% schema coverage, and no output schema, the description provides good context: purpose, usage timing, and output structure. It could be more complete by explaining what 'conversionKind' means or providing more detail on the explanation format, but it covers the essentials well given the tool's complexity.

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 both parameters (sourceType and targetType) with examples. The description adds minimal value by showing a usage example with the same examples as the schema, but doesn't provide additional semantic context beyond what's in the structured fields.

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 verbs ('check if one type can be assigned to another') and resources (types). It distinguishes from sibling tools by focusing on type compatibility rather than analysis, refactoring, or navigation tasks listed in the sibling tool names.

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?

The description explicitly states when to use this tool ('Use before generating assignments or casts'), providing clear context for its application. It differentiates from alternatives by focusing on type compatibility checks rather than other code operations available in the sibling 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