Skip to main content
Glama
beruang
by beruang

lsp_code_actions_preview

Preview LSP code actions (quickfixes, refactors, source actions) for a file range or diagnostic. No commands executed, no files written.

Instructions

Return available LSP code actions (quickfixes, refactors, source actions) for a range or diagnostic, with safe edit previews. No commands are executed and no files are written.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
onlyNoFilter by code action kinds.
rangeNoSelection range.
filePathYesAbsolute or workspace-relative path to the file.
maxActionsNoMax actions to return.
includeDiffNoInclude diffs for edit actions.
diagnosticIndexesNoIndexes of diagnostics to target.
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 explicitly states the tool is read-only and previews edits without executing commands or writing files, which is sufficient for a safe preview tool. It could mention that it relies on the LSP server, but that is implied by the tool family.

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 extremely concise with two sentences. The first sentence states the main action, and the second clarifies safety. No unnecessary words or redundancy.

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?

Given 6 parameters (including nested objects) and no output schema, the description is somewhat incomplete. It does not describe the return format (e.g., list of code actions with edits and diffs). The mention of 'safe edit previews' hints at the output but is insufficient. The agent would benefit from knowing what to expect in the response.

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 all parameters have descriptions. The description adds value by mentioning 'for a range or diagnostic,' which maps to the range and diagnosticIndexes parameters. This provides context but does not significantly surpass the schema's own descriptions. 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 verb 'Return' and the resource 'LSP code actions', enumerates types (quickfixes, refactors, source actions), and specifies the context (for a range or diagnostic). It distinguishes the tool from execution-related siblings like lsp_resolve_code_action by emphasizing safe edit previews and no execution.

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 provides clear context that the tool returns previews without side effects, strongly implying use for reviewing actions before applying. It explicitly states 'No commands are executed and no files are written,' which guides the agent to use other tools (e.g., lsp_resolve_code_action) for actual application. However, it does not explicitly name alternatives.

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/beruang/lsp-mcp'

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