findAndReplaceTextInDocument

Find and replace EXACT substrings in a document (NOT regex: wildcards and patterns are matched literally). Replaces EVERY occurrence and returns the replacement count; best for renames and repeated phrases. For a single targeted change at a known location, prefer editDocument (anchor patches). Ca...

SERVERStable Baseline SOURCEhttps://api.stablebaseline.io/functions/v1/cloud-serve/mcp
Medium RISK CLASS
Category Write
Parameters 63 required
Recommended Rate-limitedsee the rule below
Registry record Grade F, identity unverified Pull the record →

This record as markdown: /tools/io-stablebaseline-sb/findandreplacetextindocument.md

What findAndReplaceTextInDocument does on Stable Baseline

AI agents use findAndReplaceTextInDocument to create or update resources in Stable Baseline, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Stable Baseline environment.

ParameterTypeRequiredDescription
find string Yes Text to search for.
replace string Yes Replacement text. Empty string to delete occurrences.
documentId string Yes
caseSensitive boolean Case-sensitive matching. Default: true.
changeSummary string Version history summary.
versionTimestamp number Optional optimistic-lock token from getDocument() or a previous write; validated when provided. (Alias accepted: documentVersionTimestamp.)

Parameters from the server's own tool schema.

Why findAndReplaceTextInDocument is rated Medium

This tool modifies document content by replacing text occurrences. It is a write operation (text substitution) that is reversible in principle, though replacing every occurrence of a substring across a document could have broad impact if misused. It does not delete data irreversibly or execute code, placing it firmly in Write.

From the tool's definition Find and replace EXACT substrings in a document... Replaces EVERY occurrence and returns the replacement count

Questions about findAndReplaceTextInDocument

What does the findAndReplaceTextInDocument tool do? +

Find and replace EXACT substrings in a document (NOT regex: wildcards and patterns are matched literally). Replaces EVERY occurrence and returns the replacement count; best for renames and repeated phrases. For a single targeted change at a known location, prefer editDocument (anchor patches). Case-sensitive by default. Diagrams/images are automatically protected — only document text is affected. Returns document.versionTimestamp (the fresh optimistic-lock token) like every other mutating tool, so you can chain straight into editDocument or the diagram tools. Pass versionTimestamp to opt into optimistic locking (optional here — whole-document find/replace is position-independent). Note: when the replace value contains a <!-- REFERENCE: {...} --> marker (e.g. inserting a user mention), it round-trips losslessly through the editor and triggers notifications if it adds a new user mention. It is categorised as a Write tool in the Stable Baseline MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.

What parameters does findAndReplaceTextInDocument accept? +

findAndReplaceTextInDocument accepts 6 parameters: find, replace, documentId, caseSensitive, changeSummary, versionTimestamp. Required: find, replace, documentId. The full parameter table on this page comes from the server's own tool schema.

How do I enforce a policy on findAndReplaceTextInDocument? +

Register the Stable Baseline MCP server in PolicyLayer and add a rule for findAndReplaceTextInDocument: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Stable Baseline. Nothing to install.

What risk level is findAndReplaceTextInDocument? +

findAndReplaceTextInDocument is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.

Can I rate-limit findAndReplaceTextInDocument? +

Yes. Add a rate_limit block to the findAndReplaceTextInDocument rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.

How do I block findAndReplaceTextInDocument completely? +

Set action: deny in the PolicyLayer policy for findAndReplaceTextInDocument. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.

What MCP server provides findAndReplaceTextInDocument? +

findAndReplaceTextInDocument is provided by the Stable Baseline MCP server (https://api.stablebaseline.io/functions/v1/cloud-serve/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.

More on Stable Baseline, and thousands of servers like it.

Across the catalogue

// THE MCP REGISTRY

PolicyLayer tracks 44,603 MCP servers and 515,000+ tools.

Every server has a live record: who publishes it, whether it answers without auth, its risk grade, every tool classified, the recommended policy. This page is one line of Stable Baseline's. Pull the full record:

Teams ship this data inside their own products. See what a licence covers →

// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.