Skip to main content
Glama

complex_find_replace

Perform advanced find and replace operations in files using context-aware regular expressions to modify text patterns efficiently.

Instructions

Perform advanced find and replace operations with context awareness

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the file to perform find and replace on
patternYesRegular expression pattern to search for
replacementYesReplacement text
optionsNoAdditional options for the find and replace operation

Implementation Reference

  • src/index.ts:272-303 (registration)
    Registers the 'complex_find_replace' tool including its input schema, description, and annotations.
    mcpServer.registerTool({ name: 'complex_find_replace', description: 'Perform advanced find and replace operations with context awareness', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Path to the file to perform find and replace on' }, pattern: { type: 'string', description: 'Regular expression pattern to search for' }, replacement: { type: 'string', description: 'Replacement text' }, options: { type: 'object', description: 'Additional options for the find and replace operation' } }, required: ['path', 'pattern', 'replacement'] }, annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false } });
  • Main handler for 'complex_find_replace' tool: creates an edit session and delegates to EditInstanceManager.executeEditCommand with a 'replace' command.
    case 'complex_find_replace': return this.editInstanceManager.executeEditCommand(sessionId, { type: 'replace', params: { pattern: operation.params.pattern, replacement: operation.params.replacement, options: operation.params.options } });
  • Implements the replace operation (used by complex_find_replace) by executing a 'replace' command on the editor instance.
    case 'replace': result = await instance.executeCommand(`replace ${command.params.pattern} ${command.params.replacement}`); return { success: true, message: result };

Latest Blog Posts

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/mixelpixx/edit-mcp'

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