Skip to main content
Glama
santanusinha

neovim-use-mcp

by santanusinha

Replace a line range

nvim_edit_lines
Destructive

Replace file lines with new text by line range and receive updated LSP diagnostics. Saves the buffer without format-on-save to keep the diff minimal.

Instructions

This is the default way to edit files. Use the provided line numbers to directly replace lines start_line..end_line (1-based, inclusive) with new text. Saves the buffer by default without running format-on-save autocmds, so the diff is minimal. Returns fresh LSP diagnostics for the file.Use nvim_format to format after editing once editing and fixes on that are done.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path
saveNoWrite the buffer, default true
textYesReplacement text; use \n for several lines
end_lineYesLast line to replace, inclusive
start_lineYesFirst line to replace, 1-based
Behavior5/5

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

Beyond the destructiveHint annotation, the description discloses key behaviors: the buffer is saved by default, format-on-save autocmds are skipped to keep the diff minimal, and fresh LSP diagnostics are returned. This is valuable operational context an agent needs before invoking a destructive edit.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded with the core behavior, then covers side effects and follow-up. The final sentence is slightly awkward ('once editing and fixes on that are done') and the missing space after 'file.Use' is a minor flaw, but no sentence is wasted.

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 simple schema, no output schema, and the presence of annotations, the description covers the essential action, default save behavior, formatting caveat, and return value. It could mention behavior when save=false or how invalid line ranges are handled, but those are minor given the rich schema coverage.

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 coverage is 100%, so the baseline is 3. The description reinforces the inclusive, 1-based line range semantics, but the schema already documents each parameter clearly. The description does not need to add much beyond what the schema provides.

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 uses a specific verb and resource: 'directly replace lines start_line..end_line' with new text. It also positions itself as 'the default way to edit files,' which helps an agent distinguish it from the other editing-related sibling tools.

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 clearly establishes this as the default editing tool and gives follow-up guidance to use nvim_format afterward. It does not explicitly describe when to choose nvim_insert_lines or nvim_edit_text instead, but the 'default way to edit' framing provides sufficient context.

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/santanusinha/neovim-use-mcp'

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