Skip to main content
Glama

Refactor MCP

by myuon

code_refactor

Automate code refactoring by replacing specific search patterns with defined replacement patterns using regex. Optional context and file patterns limit scope, while capture groups and matched text inclusion enhance precision.

Instructions

Refactor code by replacing search pattern with replace pattern using regex

Input Schema

NameRequiredDescriptionDefault
context_patternNoOptional context pattern to filter matches
file_patternNoOptional file glob pattern to limit search scope
include_capture_groupsNoInclude capture groups in the results
include_matched_textNoInclude matched text in the results
replace_patternYesReplacement pattern (can use $1, $2, etc. for capture groups)
search_patternYesRegular expression pattern to search for

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "context_pattern": { "description": "Optional context pattern to filter matches", "type": "string" }, "file_pattern": { "description": "Optional file glob pattern to limit search scope", "type": "string" }, "include_capture_groups": { "description": "Include capture groups in the results", "type": "boolean" }, "include_matched_text": { "description": "Include matched text in the results", "type": "boolean" }, "replace_pattern": { "description": "Replacement pattern (can use $1, $2, etc. for capture groups)", "type": "string" }, "search_pattern": { "description": "Regular expression pattern to search for", "type": "string" } }, "required": [ "search_pattern", "replace_pattern" ], "type": "object" }

Other Tools from Refactor MCP

Related Tools

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/myuon/refactor-mcp'

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