Skip to main content
Glama

Enhanced Directory Context MCP Server

by PWalaGov

update_file

Modify file content by performing search and replace operations, supporting exact matches or regex, with optional backup creation for safety.

Instructions

Update specific parts of a file using search and replace

Input Schema

NameRequiredDescriptionDefault
backupNoCreate backup before updating (.bak extension)
pathYesFile path relative to working directory
updatesYesArray of search/replace operations

Input Schema (JSON Schema)

{ "properties": { "backup": { "default": true, "description": "Create backup before updating (.bak extension)", "type": "boolean" }, "path": { "description": "File path relative to working directory", "type": "string" }, "updates": { "description": "Array of search/replace operations", "items": { "properties": { "all": { "default": true, "description": "Replace all occurrences", "type": "boolean" }, "regex": { "default": false, "description": "Use regex for search", "type": "boolean" }, "replace": { "description": "Text to replace with", "type": "string" }, "search": { "description": "Text to search for (exact match)", "type": "string" } }, "required": [ "search", "replace" ], "type": "object" }, "type": "array" } }, "required": [ "path", "updates" ], "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/PWalaGov/File-Control-MCP'

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