Skip to main content
Glama
TripQi

Code Editor MCP Server

by TripQi

edit_block

Search and replace text in files with options for match validation, whitespace handling, and conflict detection to modify code or content.

Instructions

Search and replace text in a file.

Args: file_path: Absolute path to the file. old_string: Text to find. new_string: Replacement text. expected_replacements: Required match count (default 1). expected_mtime: Conflict detection timestamp. ignore_whitespace: Match with flexible whitespace. normalize_escapes: Unescape \n, \t, etc. in search. encoding: File encoding (utf-8, gbk, gb2312).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
old_stringYes
new_stringYes
expected_replacementsNo
expected_mtimeNo
ignore_whitespaceNo
normalize_escapesNo
encodingNoutf-8

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions 'Conflict detection timestamp' for 'expected_mtime' but lacks details on permissions, error handling, or what happens if 'expected_replacements' mismatches. For a mutation tool, this leaves significant behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear purpose statement followed by parameter explanations. It is appropriately sized, though some parameter details could be more concise (e.g., 'Match with flexible whitespace' for 'ignore_whitespace' is slightly verbose).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 8 parameters with 0% schema coverage and no annotations, the description provides good parameter semantics but lacks behavioral context for a mutation tool. The presence of an output schema reduces the need to explain return values, but overall completeness is moderate due to missing usage guidelines and transparency.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaningful context for all 8 parameters, explaining their purposes (e.g., 'Required match count' for 'expected_replacements', 'Conflict detection timestamp' for 'expected_mtime'). However, it lacks specifics like format for 'expected_mtime' or examples for 'encoding'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Search and replace text in a file'), identifies the resource ('a file'), and distinguishes it from siblings like 'read_file' or 'file_ops' by focusing on text replacement rather than reading or general file operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention sibling tools like 'edit_blocks' (plural) or 'convert_file_encoding', nor does it specify prerequisites, exclusions, or appropriate contexts for use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/TripQi/code-editor'

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