mcp-text-editor

by tumf
MIT License
37
  • Apple
  • Linux

get_text_file_contents

Read text file contents from multiple files and line ranges. Returns file contents with hashes for concurrency control and line numbers for reference. The hashes are used to detect conflicts when editing the files. File paths must be absolute.

Input Schema

NameRequiredDescriptionDefault
encodingNoText encoding (default: 'utf-8')utf-8
filesYesList of files and their line ranges to read

Input Schema (JSON Schema)

{ "properties": { "encoding": { "default": "utf-8", "description": "Text encoding (default: 'utf-8')", "type": "string" }, "files": { "description": "List of files and their line ranges to read", "items": { "properties": { "file_path": { "description": "Path to the text file. File path must be absolute.", "type": "string" }, "ranges": { "description": "List of line ranges to read from the file", "items": { "properties": { "end": { "description": "Ending line number (null for end of file)", "type": [ "integer", "null" ] }, "start": { "description": "Starting line number (1-based)", "type": "integer" } }, "required": [ "start" ], "type": "object" }, "type": "array" } }, "required": [ "file_path", "ranges" ], "type": "object" }, "type": "array" } }, "required": [ "files" ], "type": "object" }