Skip to main content
Glama

LSP MCP Server

by sminnee

extract_function

Refactor code by extracting selected lines into a new named function to improve modularity and reusability.

Instructions

Extract selected code into a new function

Input Schema

NameRequiredDescriptionDefault
endCharacterNoEnd character position
endLineYesEnd line of code to extract
fileYesFile containing the code to extract
functionNameYesName for the new function
languageNoProgramming languagetypescript
startCharacterNoStart character position
startLineYesStart line of code to extract

Input Schema (JSON Schema)

{ "properties": { "endCharacter": { "default": 0, "description": "End character position", "type": "number" }, "endLine": { "description": "End line of code to extract", "type": "number" }, "file": { "description": "File containing the code to extract", "type": "string" }, "functionName": { "description": "Name for the new function", "type": "string" }, "language": { "default": "typescript", "description": "Programming language", "type": "string" }, "startCharacter": { "default": 0, "description": "Start character position", "type": "number" }, "startLine": { "description": "Start line of code to extract", "type": "number" } }, "required": [ "file", "startLine", "endLine", "functionName" ], "type": "object" }

Other Tools from LSP MCP Server

Related Tools

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

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