Skip to main content
Glama

Document Replace

document_replace
Destructive

Use this to replace specified matching text in a user-selected local word-processing document. Check the search string, replacement and destination; edits change document content.

Input Schema

NameRequiredDescriptionDefault
allNoApply to all matching paragraphs; default true.
pathYesExisting .docx path, or the new document destination when create=true.
createNoCreate a new DOCX at path. Fails if path already exists; do not combine with output.
deviceYesReMCP device id returned by list_devices. Required for every device operation.
outputNoOptional output .docx path when editing an existing document.
searchYesParagraph text substring for replace/insert/delete operations.
replacementYesReplacement text for matching document content.

Output Schema

NameRequiredDescriptionDefault
dataNoEdit DOCX document structured result for edit_document. Stable fields are declared explicitly; platform-specific fields may be added. Large results may return truncated/bytes/preview instead of the full payload.
textYesConcise human-readable result of the tool call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.6/5.0
Behavior4/5

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

The description reinforces the behavioral trait of mutation with the phrase 'edits change document content.' This adds value beyond the `destructiveHint: true` annotation by making the consequence of the operation explicit to the agent.

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 tool definition is extremely concise, using two sentences to define the function and issue a necessary check. The language is direct and avoids unnecessary padding.

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?

Given the excellent input schema and clear behavioral annotations (destructive/non-read-only), the description provides sufficient high-level context for the agent to decide if this is the right tool to use for a replacement task.

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 100%, meaning the structure provides all necessary semantic meaning. The description adds no value in explaining what the parameters (`search`, `path`, `replacement`) represent beyond the high-level concept of 'specified matching text' or 'replacement.'

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 the specific action (replace text) and the target resource (local word-processing document). While functional, it does not explicitly differentiate this from other document modification siblings like paragraph insertion, making the scope slightly less precise.

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?

The description serves as a warning rather than a guideline. It advises the agent to check the parameters but offers no instructional context on when to use this tool versus related replacement tools (e.g., `replace_lines`) or other modification tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources