Skip to main content
Glama

lsp_code_actions

Retrieve and apply code actions like quick fixes, refactoring operations, and import organization at specific positions in source files to automate code improvements.

Instructions

Get available code actions (refactorings, quick fixes) at a position or range. Use for automated fixes, imports organization, and refactoring operations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the source file
start_lineYesStart line number (1-indexed)
start_columnYesStart column number (1-indexed)
end_lineNoEnd line number (1-indexed). Defaults to start line.
end_columnNoEnd column number (1-indexed). Defaults to start column.
kindsNoFilter by code action kinds: quickfix, refactor, refactor.extract, refactor.inline, refactor.rewrite, source, source.organizeImports, source.fixAll
applyNoIf true, apply the first available action. If false, just list available actions.
action_indexNoIndex of the action to apply (when apply=true). Defaults to 0 (first action).

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

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