Skip to main content
Glama
TripQi

Code Editor MCP Server

by TripQi

edit_block

Search and replace text in a file with support for whitespace flexibility, escape normalization, encoding options, and conflict detection.

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

Behavior3/5

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

The description discloses behavioral traits such as conflict detection via expected_mtime and flexible whitespace matching, adding value beyond the schema. However, it does not mention that the tool modifies files in place (destructive behavior) or describe the return value/output, leaving 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 reasonably concise, using a clear docstring format with Args list. Each parameter description is short but informative. It could be slightly more streamlined, but overall efficient.

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

Completeness2/5

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

Despite covering all parameters, the description lacks information about the tool's return value (especially with an output schema present), error conditions, and the fact that it modifies files (destructive nature). For a mutation tool with no annotations, this is a significant gap.

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

Parameters5/5

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

With 0% schema description coverage, the description fully compensates by explaining all 8 parameters in the Args block, including their roles (e.g., 'Required match count' for expected_replacements, 'Conflict detection timestamp' for expected_mtime). This adds substantial meaning beyond the schema's types and titles.

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

Purpose4/5

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

The description clearly states 'Search and replace text in a file,' which is a specific verb+resource combination. However, it does not differentiate from sibling tools like 'edit_blocks' or 'file_ops', leaving potential ambiguity about when to use this tool over others.

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?

There is no guidance on when to use this tool versus alternatives, nor any exclusions or prerequisites. The description lists parameters but does not explain context or scenarios where specific settings (e.g., ignore_whitespace) are advisable.

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