Skip to main content
Glama

applyCodeAction

Destructive

Apply a specific code action to a selected range in a file. Use getCodeActions first to obtain available actions.

Instructions

Apply code action by title. Use getCodeActions first to see options.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesWorkspace or absolute path
startLineYesStart line (1-based)
startColumnYesStart column (1-based)
endLineYesEnd line (1-based)
endColumnYesEnd column (1-based)
actionTitleYesExact action title from getCodeActions output
Behavior3/5

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

Annotations already provide destructiveHint: true, so the description need not repeat that. The description does not add further behavioral context (e.g., whether changes are saved), but is adequate given the annotation coverage.

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 two short sentences, front-loading the action and providing prerequisite guidance. Every word earns its place; highly concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While the description covers the basic purpose and prerequisite, it omits details about what happens after applying (e.g., file modification, success/failure feedback). Given the tool's complexity and destructive hint, it could be more complete, but is minimally adequate.

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?

The input schema has 100% description coverage for all 6 parameters, so the schema does the heavy lifting. The description adds no extra parameter-level meaning, so baseline 3 is appropriate.

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 applies a code action by title and explicitly mentions the prerequisite step of using getCodeActions. This distinguishes it from siblings like getCodeActions and previewCodeAction.

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?

The description explicitly advises to use getCodeActions first to see options, providing clear usage guidance. It lacks explicit when-not-to-use instructions but the context is sufficiently clear.

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/Oolab-labs/patchwork-os'

If you have feedback or need assistance with the MCP directory API, please join our Discord server