Skip to main content
Glama
Menglook
by Menglook

Edit File

edit
Destructive

Apply an exact text replacement inside a workspace file, returning a unified diff. Replace all occurrences or target a single match, with failure on mismatched replacement counts.

Instructions

Apply a targeted exact text replacement inside a workspace text file. Returns a unified diff.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path relative to workspace root.
new_textYesReplacement text.
old_textYesExact text to replace. Must match once unless replace_all=true.
task_modeNoOptional Task Router mode override for this edit.
replace_allNoReplace all occurrences. Default: false.
workspace_idNoOptional workspace id. When omitted, CodexPro binds the authoritative conversation workspace automatically; an explicit unknown or mismatched id is rejected.
conversation_idNoConnector conversation id bound to this workspace. Modern MCP injects it automatically; side-effecting tools require it to match the authoritative binding.
task_instructionNoOriginal user task. Required in progressive mode so Task Router can verify write intent.
workspace_generationNoOptional authoritative workspace generation. When omitted, CodexPro injects the conversation-bound generation; an explicit stale generation is rejected.
expected_replacementsNoFail if actual replacement count differs.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
tool_resultYes
Behavior3/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, idempotentHint=false, which fully disclose the mutation profile. The description adds that it 'Returns a unified diff' (useful behavioral context) and mentions 'exact text replacement'. However, it doesn't disclose behaviors around replace_all verification, task_mode routing implications, or the workspace/conversation binding requirements that are clearly significant given deprecated/new parameter complexity. The description carries some burden beyond annotations but doesn't fully address the side-effecting runtime checks.

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

Conciseness5/5

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

The description is two sentences with zero filler. It front-loads the core purpose and includes the key return value ('unified diff') immediately. Every word earns its place.

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?

With 10 parameters (many conditional: task_mode, task_instruction, workspace_generation, expected_replacements) and output schema present, this is a complex tool. The output schema covers the return value, so that's handled. However, the description doesn't help the agent navigate which parameters are required in which modes (e.g., when task_instruction is mandatory in progressive mode, when expected_replacements should be set). The annotations convey destructive behavior. It's acceptable but leaves the agent to discover mode-dependent requirements from schema alone.

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 100%, so the schema already fully documents all 10 parameters with descriptions. The description adds value by clarifying the edit is a 'targeted exact text replacement' (reinforcing old_text/new_text semantics) and by mentioning the unified diff return. However, the description doesn't clarify nuances like why 'Must match once unless replace_all=true' matters, or how task_mode/task_instruction interact with progressive mode verification. Baseline 3 for 100% coverage, but the description's diff annotation and exact-match emphasis push it to a 4.

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 states a specific verb+object ('Apply a targeted exact text replacement inside a workspace text file') that clearly conveys the core function. It doesn't explicitly distinguish from the sibling 'write' tool, though the word 'targeted exact text replacement' implies surgical edits vs full-file writes. A 4 is appropriate since purpose is clear but sibling differentiation is implicit rather than explicit.

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 versus the sibling 'write' tool, 'apply_patch_bundle', or other editing alternatives. The description implies usage for targeted file modifications but provides no exclusions or alternative tool recommendations. With 25+ siblings including 'write', explicitly distinguishing edit-vs-write would substantially help agent selection.

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/Menglook/codexpro-runtime'

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