Skip to main content
Glama

edit_file

Replace a substring in a WSL file with new text, including dry-run preview and replace-all options.

Instructions

Line/substring-based edit of a WSL file: replace oldString with newString. oldString must be unique unless replaceAll=true. Use dryRun=true to preview.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
distroNo
dryRunNo
newStringYes
oldStringYes
replaceAllNo
Behavior3/5

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

With no annotations, the description carries full disclosure burden. It reveals the uniqueness constraint and dryRun preview feature, but does not explain failure modes (e.g., what happens if oldString is not found), whether the file must pre-exist, or any permission requirements. This is adequate but incomplete for a mutation tool.

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?

Two sentences deliver the core purpose, a key constraint, and the preview option without fluff. Every word earns its place; no redundant phrasing.

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

Completeness3/5

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

Given the tool has 6 parameters and no output schema, the description covers the main edit operation but falls short on the distro parameter and failure behavior. It's moderately complete for a simple edit tool, but the missing parameter semantics and lack of error disclosure prevent a higher score.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must explain all parameters. It explains oldString, newString, replaceAll, and dryRun, but completely omits 'distro' and 'path', which are core parameters. Without schema descriptions, the distro parameter's purpose remains unclear, making this a significant gap.

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 it performs line/substring-based edits on a WSL file, replacing oldString with newString. This distinguishes it from siblings like write_file, which creates/overwrites whole files, and read_file, which reads content. The verb 'edit' and resource 'WSL file' are specific.

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?

Provides concrete guidance: oldString must be unique unless replaceAll=true, and dryRun=true is recommended for previewing. While it doesn't explicitly contrast with write_file, the substring-based nature implies editing existing content, and the dryRun/replaceAll hints give practical usage 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/Darling209/wsl-bridge-mcp'

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