Vertex AI MCP Server

by shariqriazz
Verified

edit_file_content

Modify text files by replacing specified content with new text, preserving indentation and generating a git-style diff. Use it to preview changes or apply edits directly to files in the workspace.

Instructions

Make line-based edits to a text file in the workspace filesystem. Each edit attempts to replace an exact match of 'oldText' with 'newText'. If no exact match is found, it attempts a line-by-line match ignoring leading/trailing whitespace. Indentation of the first line is preserved, and relative indentation of subsequent lines is attempted. Returns a git-style diff showing the changes made (or previewed if dryRun is true).

Input Schema

NameRequiredDescriptionDefault
dryRunNoIf true, preview changes using git-style diff format without saving.
editsYesAn array of edit operations to apply sequentially.
pathYesThe path of the file to edit (relative to the workspace directory).

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "dryRun": { "default": false, "description": "If true, preview changes using git-style diff format without saving.", "type": "boolean" }, "edits": { "description": "An array of edit operations to apply sequentially.", "items": { "additionalProperties": false, "properties": { "newText": { "description": "Text to replace with, preserving indentation where possible.", "type": "string" }, "oldText": { "description": "Text to search for - attempts exact match first, then line-by-line whitespace-insensitive match.", "type": "string" } }, "required": [ "oldText", "newText" ], "type": "object" }, "type": "array" }, "path": { "description": "The path of the file to edit (relative to the workspace directory).", "type": "string" } }, "required": [ "path", "edits" ], "type": "object" }
ID: 4flmun3tjc