Skip to main content
Glama
bounded-filesystem-mcp

bounded-filesystem-mcp

by shivam-bit

Edit File

edit_file
Destructive

Make line-based edits to text files by replacing exact line sequences with new content and returning a git-style diff. Preview changes or apply them only within allowed directories.

Instructions

Make line-based edits to a text file. Each edit replaces exact line sequences with new content. Returns a git-style diff showing the changes made. Only works within allowed directories.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>",
      "edits": "<edits>"
    },
    "name": "edit_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
editsYes
dryRunNoPreview changes using git-style diff format

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, non-read-only, and non-idempotent. The description adds useful behavioral context: edits must match exactly, a git-style diff is returned, and operation is limited to allowed directories. It does not describe failure or partial-application behavior, but the annotation coverage lowers the burden.

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 four tight sentences with no waste. Core purpose and matching constraint are front-loaded, followed by return behavior and access constraint.

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?

For a destructive edit tool with no output schema, the description explains the return value as a git-style diff and notes the allowed-directory restriction. It leaves some edge-case behavior unspecified, but covers the essentials for correct invocation.

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 low at 33%, with path and the edits array itself undocumented. The description partially compensates by clarifying exact line matching and allowed-directory restrictions, while dryRun remains explained only in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: line-based edits to a text file, replacing exact line sequences. This distinguishes it from sibling tools like write_file, though it does not explicitly name the alternative or contrast behavior.

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

Usage Guidelines3/5

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

Usage is implied by 'line-based edits' and 'exact line sequences,' suggesting targeted edits rather than full-file writes. However, it does not explicitly say when to use this versus write_file or what to do if an exact match fails.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.