Skip to main content
Glama
redf0x1

MCP-Server-Filesystem

by redf0x1

edit_file

Modify text files with line-based edits, automatic syntax validation for common formats, and optional dry-run previews that return git-style diffs to verify changes before applying.

Instructions

Make line-based edits to a text file with intelligent syntax validation. Each edit replaces exact line sequences with new content. Automatically validates syntax for JavaScript, TypeScript, JSON, YAML, XML/HTML files. Returns detailed error messages if validation fails to help fix syntax issues. Use dryRun=true to preview changes, skipValidation=true to bypass syntax checks. Returns a git-style diff showing the changes made. Only works within allowed directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
editsYes
dryRunNoPreview changes using git-style diff format
skipValidationNoSkip syntax validation for the file type
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses syntax validation for specific file types, detailed error messages, dryRun and skipValidation options, git-style diff output, and allowed-directory restrictions. It does not mention atomicity or what happens if oldText is not found, but covers key behaviors well.

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 concise and front-loaded with the core purpose. Every sentence adds value: purpose, edit semantics, validation, options, return format, and constraints. No wasted words.

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?

For a 4-parameter tool with no output schema, the description is highly complete. It covers the edit operation, validation behavior, preview option, return format, and directory restrictions. It is sufficient for an agent to use 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?

The description adds meaning beyond the schema: 'Each edit replaces exact line sequences with new content' explains oldText/newText semantics, and 'Use dryRun=true to preview changes' clarifies the boolean parameters. Path format is unspecified, but the allowed-directories constraint gives context.

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 'Make line-based edits to a text file' with a specific verb, resource, and approach. It also distinguishes itself from siblings like write_file (full-file overwrite) and delete_file by emphasizing targeted line replacement and syntax validation.

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?

Clear context is given: line-based edits, syntax validation, and dry-run previews. However, it does not explicitly mention alternatives like write_file or when not to use this tool, so it lacks explicit exclusions or alternatives.

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/redf0x1/MCP-Server-Filesystem'

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