Skip to main content
Glama

replace_text

Replace text in Word documents with track changes, allowing reviewers to accept or reject each modification via Word's revision interface.

Instructions

以修订模式(Track Changes)替换文档中的文本。

修改不会直接生效,而是写成 Word 修订(删除线 + 下划线),由用户在 Word 审阅界面逐条接受/拒绝。old_text 在全文只出现一次时才会替换;出现多次时 需提供更长的唯一上下文,或明确 replace_all=True 全部替换。 new_text 传空字符串表示纯删除。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
authorNoAI 律师助手
new_textYes
old_textYes
replace_allNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description bears full responsibility for behavioral disclosure. It transparently explains the Track Changes behavior, the condition that old_text must appear only once for replacement, and that empty new_text means deletion. It lacks details on permissions or response format, but the core behavioral traits are well communicated.

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 concise, using a single paragraph with line breaks for clarity. It front-loads the key purpose and behavioral details. Every sentence adds value, though some parameter descriptions could be more structured. It achieves good readability without excessive verbosity.

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?

The tool has 5 parameters and an output schema (not shown). The description covers the main behavioral aspects and parameter usage for the most critical parameters. It does not address the return value, but the presence of an output schema mitigates this. The description is mostly complete for a text replacement tool, though missing details on path and author could be improved.

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?

The input schema has 5 parameters with 0% schema description coverage. The description adds meaning to old_text (must appear once), new_text (empty means deletion), and replace_all (boolean to replace all). However, path and author parameters are not explained; path's role as document path is implicit, and author's default value is not described. The description partially compensates for the schema gaps but not fully.

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 replaces text using Track Changes mode, with specific verb '替换' (replace) and resource '文档中的文本' (text in document). It distinguishes from siblings like delete_paragraph and insert_paragraph, which operate on different structural units.

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

Usage Guidelines4/5

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

The description provides clear usage context: it replaces text with revisions, noting that modifications are not direct but become Word revisions. It specifies conditions for replacement (single occurrence) and options (replace_all=True). However, it does not explicitly state when not to use the tool or suggest alternatives beyond the implicit context.

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/leeyang0916/word-agent-mcp'

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