Skip to main content
Glama
santanusinha

neovim-use-mcp

by santanusinha

Replace exact text

nvim_edit_text
Destructive

Replace exact text in a file using a real Neovim instance, failing if the string is missing or ambiguous. Control saving and replace-all behavior for precise edits.

Instructions

Replace an exact string in a file. Fails if the string is missing, or if it appears more than once and replace_all is false. Saves without running format-on-save autocmds by default. It is recommended to avoid using this tool for multi-line edits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path
saveNoWrite the buffer, default true
new_textYesReplacement text
old_textYesExact text to find, including indentation
replace_allNoReplace every match, default false
Behavior5/5

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

Adds substantial behavior beyond the destructiveHint annotation: failure when the string is missing, failure on multiple matches unless replace_all is true, default save behavior, and format-on-save autocmd suppression. These details are not present in the annotations and do not contradict them.

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?

Three sentences with the core action front-loaded; every sentence earns its place by covering failure conditions, save/autocmd behavior, and a usage caution. Zero filler.

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?

Covers core action, failure modes, save behavior, and a usage caution; combined with the destructiveHint annotation this is nearly complete for a mutation tool. Gaps: return-value behavior is unspecified and no output schema exists, and the multi-line alternative tool is unnamed.

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 only lightly enriches parameters by tying replace_all semantics to the multiple-match failure condition; it adds no syntax or format details for old_text/new_text beyond the schema descriptions.

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?

States a specific verb ('Replace') and resource ('an exact string in a file'), and 'exact string' scope clearly distinguishes it from line-based siblings like nvim_edit_lines and nvim_insert_lines. The title 'Replace exact text' aligns cleanly with the description.

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?

Gives an explicit when-not-to-use: 'It is recommended to avoid using this tool for multi-line edits,' which steers agents toward the line-based siblings. However, it never names the specific alternative tool, so the agent must infer which sibling to pick.

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