Skip to main content
Glama
mjyoo2
by mjyoo2

replace_text

Replaces all occurrences of a specified text string in an open HWP document with new text, returning the number of replacements made.

Instructions

Replace all occurrences of text in the document.

Args: doc_id: Document ID from open_document old_text: Text to find new_text: Replacement text

Returns: Number of replacements made

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_idYes
new_textYes
old_textYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

With no annotations, the description carries the burden of explaining side effects. It discloses that replacement is global and that a replacement count is returned, but does not mention mutability/irreversibility, scope limitations, or behavior when old_text is not found. This is adequate but not rich.

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 short, structured with Args and Returns, and contains no redundant sentences. Every line contributes relevant information.

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 simple three-string-parameter tool, the description covers the operation, parameter source, and return value, and an output schema exists to formalize returns. It lacks usage exclusions and edge-case behavior, but nothing essential is missing for a basic replacement call.

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?

Schema description coverage is 0%, so every parameter must be explained in the description. The Args block clearly defines doc_id as coming from open_document, old_text as the text to find, and new_text as the replacement text, adding real meaning beyond the schema's bare titles.

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 names a specific operation ('Replace all occurrences of text') and a clear resource ('the document'), which distinguishes it from siblings like insert_text, search_text, and replace_action. It is more specific than a bare restatement of the tool name.

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 makes the intended context clear: a document-wide replacement of all occurrences, with doc_id sourced from open_document. It does not explicitly mention when to prefer another sibling (e.g., replace_action) or list exclusions, so it stops short of a 5.

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/mjyoo2/hwp-mcp'

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