mcp-text-editor
by tumf
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
Name | Required | Description | Default |
---|---|---|---|
encoding | No | Text encoding (default: 'utf-8') | utf-8 |
file_hash | Yes | Hash of the file contents for concurrency control. it should be matched with the file_hash when get_text_file_contents is called. | |
file_path | Yes | Path to the text file. File path must be absolute. | |
ranges | Yes | List 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"
}