mcp-text-editor

by tumf
MIT License
25
  • Apple
  • Linux

delete_text_file_contents

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

NameRequiredDescriptionDefault
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.
rangesYesList of line ranges to delete

Input Schema (JSON Schema)

{ "properties": { "encoding": { "default": "utf-8", "description": "Text encoding (default: 'utf-8')", "type": "string" }, "file_hash": { "description": "Hash of the file contents for concurrency control. it should be matched with the file_hash when get_text_file_contents is called.", "type": "string" }, "file_path": { "description": "Path to the text file. File path must be absolute.", "type": "string" }, "ranges": { "description": "List of line ranges to delete", "items": { "properties": { "end": { "description": "Ending line number (null for end of file)", "type": [ "integer", "null" ] }, "range_hash": { "description": "Hash of the content being deleted. it should be matched with the range_hash when get_text_file_contents is called with the same range.", "type": "string" }, "start": { "description": "Starting line number (1-based)", "type": "integer" } }, "required": [ "start", "range_hash" ], "type": "object" }, "type": "array" } }, "required": [ "file_path", "file_hash", "ranges" ], "type": "object" }