Skip to main content
Glama

edit_file

Make line-based edits to text files by replacing specific line sequences with new content. Returns a git-style diff showing all changes made to the file.

Instructions

Make line-based edits to a text file. Provide original lines and their replacements. Returns a git-style diff showing the changes made. Each edit replaces exact line sequences with new content.

Input Schema

NameRequiredDescriptionDefault
pathYesThe path to the file to edit
editsYesArray of edit operations to apply

Input Schema (JSON Schema)

{ "properties": { "edits": { "description": "Array of edit operations to apply", "items": { "properties": { "newText": { "description": "The text to replace it with", "type": "string" }, "oldText": { "description": "The exact text to search for (can be multiple lines)", "type": "string" } }, "required": [ "oldText", "newText" ], "type": "object" }, "type": "array" }, "path": { "description": "The path to the file to edit", "type": "string" } }, "required": [ "path", "edits" ], "type": "object" }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/koopatroopa787/first_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server