Skip to main content
Glama

preview_replace

Preview search-and-replace effects on a Word document without modifying it. See per-item match counts, paragraph context, grand total, and refusals before committing to the actual edit.

Instructions

Dry-run search_and_replace; the file is NEVER modified. Same items ({find, replace, regex?}), scope (body | footnotes | headers | all), and matching engine (fragmented-run map, guarded regex, chained items), so the preview shows exactly what a real run would change: per-item counts, each match with paragraph index and ~60 chars of before/after context, the grand total, and the refusals a real run would hit. Review, then run search_and_replace with max_replacements set to the previewed total so any drift aborts instead of over-replacing.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scopeNobody
file_pathYes
replacementsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations provided, the description carries the full disclosure burden. It clearly states non-modification, scope options, matching engine parity, and the exact output contents (counts, contexts, total, refusals). It does not mention failure modes or permission requirements, but what is disclosed is substantial and accurate.

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?

Despite being dense, the description is efficiently structured: the key fact is front-loaded, scoping details are compactly listed, and each sentence adds value. Nothing is redundant.

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 complexity and lack of annotations, the description covers purpose, safety, scope, matching behavior, and next-step guidance. It might have briefly explained the replacements array structure, but the presence of an output schema and the clear sibling reference make this a minor gap.

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 adds context by naming the replacement item fields ({find, replace, regex?}), scope values, and the matching engine, but it never directly documents file_path or the replacements array structure. It relies heavily on the sibling search_and_replace for full parameter semantics.

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 opens with 'Dry-run search_and_replace; the file is NEVER modified,' giving a specific verb, resource, and the key distinguishing behavior. It makes clear this is a preview variant of search_and_replace, not the mutation itself.

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

Usage Guidelines5/5

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

It explicitly tells the agent when to use this tool ('Review, then run search_and_replace') and even prescribes how to set max_replacements to the previewed total. This is direct, actionable guidance that routes the agent to the correct sibling.

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/nometalalchemist/KitchenSink4Word'

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