Skip to main content
Glama
xctmyy

win-cli-mcp-tmyy

by xctmyy

edit_file

Replace a targeted line range in a file with new content, with options for base64 encoding and preserving the original indentation style.

Instructions

编辑文件内容,按行范围替换(startLine-endLine,1-based)。行号是必填的,必须指定要替换的行范围。Content is auto-normalized: CRLF/CR converted to LF, leading/trailing newlines stripped. Use content_base64 to avoid JSON escaping issues. Set preserve_indent=true to auto-convert new content indentation to match the original file's style (e.g., spaces → TABs).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFull path where to write/edit the file. Supports all drives. Example: D:\output\result.txt
contentNoContent to write or insert into the file. Alternative to content_base64.
endLineNo可选:结束行号(1-based,包含)。不传则只替换 startLine 这一行。
encodingNoFile encoding (default: utf8)
startLineYes必填:起始行号(1-based,包含),指定要替换的起始行。
content_base64NoBase64-encoded content to write or insert into the file. Alternative to content, avoids JSON escaping issues for complex content (code with newlines, quotes, etc.).
return_contentNoOptional: If true, returns the new file content in the response. Default: false (not returned).
preserve_indentNoOptional: If true, auto-convert new content indentation to match the original file's indentation style (TABs vs spaces). Default: false. Example: if original uses TABs and new content uses 4-space indentation, the tool will convert 4 spaces → 1 TAB, 8 spaces → 2 TABs, etc.
Behavior4/5

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

The description discloses important behavioral traits beyond the schema: content auto-normalization (CRLF/CR to LF, stripping leading/trailing newlines) and the preserve_indent conversion behavior. Since no annotations are provided, this is valuable context, though it does not mention edge cases like out-of-range line numbers or file creation behavior.

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 purpose, then requirements, then behavioral notes. There is slight redundancy in re-emphasizing line numbers ('行号是必填的,必须指定要替换的行范围'), but each sentence contributes useful information without excessive verbosity.

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 tool has 8 parameters, no output schema, and no annotations, the description covers the essential aspects: purpose, line-range semantics, normalization behavior, and usage tips for content_base64 and preserve_indent. It does not address potential errors or return behavior, but the return_content parameter is in the schema, so the description is largely complete for an agent to invoke the tool correctly.

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

Parameters4/5

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

Schema coverage is 100%, but the description adds meaningful interpretation: it emphasizes startLine is required, explains endLine can be omitted to replace a single line, and provides practical guidance for content_base64 vs content and preserve_indent. This goes beyond the raw 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?

The description clearly states the tool's purpose: editing file content by replacing a line range (startLine-endLine, 1-based). It uses a specific verb ('编辑' = edit) and resource ('文件内容' = file content), and the line-range mechanism distinguishes it from siblings like write_file or delete_path.

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?

It offers practical usage tips, such as using content_base64 to avoid JSON escaping issues and setting preserve_indent=true to match indentation style. However, it does not explicitly compare with alternatives like write_file or when to prefer this over other tools, so it stops short of full when/when-not guidance.

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/xctmyy/win-cli-mcp-tmyy'

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