Skip to main content
Glama
lllli223

codex-workspace-codegraph-mcp

by lllli223

精确替换文件内容

edit_file
Destructive

Replace text in files only when the exact occurrence count matches expectations, preventing unintended modifications.

Instructions

仅在 old_text 出现次数与 expected_occurrences 完全一致时替换,避免误改。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
new_textYes
old_textYes
expected_occurrencesNo
Behavior4/5

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

Annotations already mark this as destructive (readOnlyHint=false, destructiveHint=true), and the description adds a valuable safety behavior beyond them: replacement is guarded by occurrence-count matching to avoid accidental edits. It does not describe what happens on mismatch, but the guardrail itself is meaningful behavioral context.

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?

A single sentence contains the operation, the condition, and the rationale with no filler. It is front-loaded with the key safety condition and reads clearly in one pass.

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

Completeness4/5

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

For a moderately simple edit tool with destructive annotations, the description covers the essential behavior and the main safety mechanism. The main omission is the failure or no-op behavior when the occurrence count does not match, but this is partially implied and not critical for basic invocation.

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

Parameters3/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 clarifies the role of old_text and expected_occurrences by linking them to the exact-count safety condition. However, it adds no explicit meaning for path or new_text, which are left to their self-explanatory parameter names.

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 identifies a replacement operation conditioned on exact occurrence count, and the title specifies file content as the resource. It is not a tautology and conveys the core function, though it does not explicitly differentiate itself from sibling editing tools like write_file or patch.

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

Usage Guidelines3/5

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

The description gives a clear precondition: replacement only happens when old_text's occurrence count matches expected_occurrences. This implies the tool should be used when that count is known, but it provides no guidance on when to prefer this tool over siblings such as write_file, patch, or apply_patch.

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/lllli223/codex-workspace-codegraph-mcp'

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