Skip to main content
Glama

roslyn:apply_code_action_by_title

Apply Roslyn code actions by title to automate .NET/C# refactoring and code fixes. Use exact or partial title matching to implement compiler-accurate changes with preview capability.

Instructions

Apply a code action by its title. Supports exact and partial matching.

USAGE: apply_code_action_by_title(filePath, line, column, title) OUTPUT: Changed files with preview or applied changes WORKFLOW: (1) Call get_code_actions_at_position first, (2) Apply with preview=true, (3) Apply with preview=false IMPORTANT: Uses ZERO-BASED coordinates (editor line - 1).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to source file
lineYesZero-based line number
columnYesZero-based column number
titleYesAction title (exact or partial match)
endLineNoOptional: end line for selection
endColumnNoOptional: end column for selection
previewNoPreview mode (default: true). Set to false to apply.
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. It discloses key behavioral traits: it uses zero-based coordinates (editor line - 1), supports exact and partial matching for titles, and outputs changed files with preview or applied changes. However, it doesn't mention error handling, performance implications, or side effects, leaving some gaps.

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 well-structured and front-loaded with the core purpose, followed by usage, output, workflow, and important notes. Every sentence earns its place by providing essential information without redundancy, making it efficient and easy to parse.

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 a code action tool with 7 parameters and no output schema, the description does a good job covering purpose, workflow, and key behaviors. However, it lacks details on error cases, return format specifics, or how partial matching works, which could be important for a tool with 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 7 parameters thoroughly. The description adds minimal value beyond the schema, only implying the workflow order and matching behavior. It doesn't provide additional syntax, format details, or examples beyond what's in the 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 states the specific action ('Apply a code action by its title') and distinguishes it from siblings like 'apply_code_fix' or 'get_code_actions_at_position' by focusing on title-based application. It specifies the resource (code action) and method (exact/partial matching), making the purpose unambiguous.

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 provides explicit workflow guidance: (1) call 'get_code_actions_at_position' first, (2) apply with preview=true, (3) apply with preview=false. This clearly defines when and how to use this tool versus alternatives, including prerequisites and a step-by-step process.

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