Skip to main content
Glama
NTHvt981

Windows Agent MCP Server

by NTHvt981

edit_file

Replace an exact string in an existing file to make precise code changes while preserving the rest of the file. Handles line endings and requires unique matches, with replace_all option.

Instructions

Replace an exact string in an existing text file.

Preferred over write_file for changing existing code: only the named region moves, so the rest of the file cannot be lost to a truncated generation.

old_string must match EXACTLY, including indentation, and must be unique in the file. If it appears more than once the edit is refused rather than guessed at -- include a surrounding line or two to disambiguate, or pass replace_all.

Line endings are handled for you: the file's own convention is detected and preserved, and CRLF/LF differences between your strings and the file are ignored when matching. So a CRLF file can be edited with plain "\n" strings and stays CRLF.

Edits are confined to the download root plus any directory listed in BIONIC_PROJECT_ROOTS.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
new_stringYes
old_stringYes
replace_allNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations available, the description carries the full burden of behavioral disclosure, and it does so thoroughly. It explains exact-match and uniqueness requirements, the refusal behavior when a match is ambiguous, automatic line-ending detection and preservation, and the filesystem confinement rules. These are meaningful behavioral traits beyond the basic operation.

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 moderately long; but each sentence adds distinct value: purpose, authoring guidance, matching rules, line-ending behavior, and scope constraint. It is front-loaded with the core purpose and the most important usage discrimination, making it easy for an agent to process.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This tool is a mutation with four parameters and no annotations, yet the description provides all essential context: what it does, when to choose it, how matching works, what happens in ambiguous cases, line-ending behavior, and filesystem boundaries. An output schema exists, so lack of return-value details is not a gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema has 0% description coverage, so the free-text description is the only semantic source. It compensates well: old_string is documented with exact matching, uniqueness, and ambiguity handling; replace_all is explained as the disambiguation alternative CUERPOS paramContext; new_string is implicitly covered through line-ending handling and replacement semantics; path is constrained by the download-root/BIONIC_PROJECT_ROOTS statement.

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 opens with a specific verb-plus-resource statement: 'Replace an exact string in an existing text file.' It also explicitly differentiates itself from the sibling write_file by stating it is 'Preferred over write_file for changing existing code' and explains why, so an agent can distinguish the tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to prefer this tool over write_file and gives the rationale (only the named region moves, so the rest of the file cannot be lost). It also provides actionable guidance for problematic cases: include surrounding lines to disambiguate duplicates or pass replace_all.

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/NTHvt981/windows-agent-mcp'

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