Skip to main content
Glama
tumf

mcp-text-editor

by tumf

delete_text_file_contents

Delete specific line ranges from a text file by providing the file path, content hash, and range hashes. Ensures safe, concurrency-controlled edits by verifying file contents before removal.

Instructions

Delete specified content ranges from a text file. The file must exist. File paths must be absolute. You need to provide the file_hash comes from get_text_file_contents.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rangesYesList of line ranges to delete
encodingNoText encoding (default: 'utf-8')utf-8
file_hashYesHash of the file contents for concurrency control. it should be matched with the file_hash when get_text_file_contents is called.
file_pathYesPath to the text file. File path must be absolute.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.2.2
    • addedInput schema / properties / ranges / items / properties / end / nullable
      Added value: +true
    • changedInput schema / properties / ranges / items / properties / end / type
      Previous value: -[
      -  "integer",
      -  "null"
      -]New value: +"integer"
  2. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It discloses that the file must exist, paths must be absolute, and that a hash is required for concurrency control. However, it doesn't disclose what happens if the hash mismatches, whether the operation is destructive/reversible, or what the return value is. The destructive nature is implied by 'Delete' but not elaborated.

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 the core action. The three sentences each add necessary context: what it does, the file existence/path requirement, and the hash prerequisite. It could be slightly more structured, but it's efficient and free of fluff.

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?

For a destructive mutation tool with no annotations and no output schema, the description should disclose more about failure modes, hash mismatch behavior, and whether the operation is reversible. It covers the key prerequisites but leaves the agent guessing about what happens on success or failure. The sibling tools and schema provide some context, but the description itself is incomplete for a destructive operation.

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 description coverage is 100%, so the schema already documents all parameters. The description adds the crucial context that file_hash comes from get_text_file_contents and that range_hash should match the one from get_text_file_contents. This adds value beyond the schema, but the schema already covers the basics, so a baseline 3 is appropriate.

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 states a specific verb ('Delete'), a specific resource ('specified content ranges from a text file'), and the key precondition that the file must exist. It clearly distinguishes itself from siblings like append_text_file_contents, insert_text_file_contents, and patch_text_file_contents by focusing on deletion of ranges.

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?

The description gives clear context: the file must exist, paths must be absolute, and the file_hash must come from get_text_file_contents. It doesn't explicitly say when to use this tool versus alternatives, but the deletion-specific wording and the mention of get_text_file_contents as a prerequisite provide adequate usage guidance.

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