text_replace
utilpeek: Find and replace in text. To sort, dedupe or number lines use text_lines. Returns the text with find replaced: literally, or as a regular expression on RE2 only (linear time for any pattern: no backtracking, so no ReDoS; backreferences and lookaround are refused), with \1 / \g<name> in ...
This record as markdown: /tools/dev-tanod-tanod/text-replace.md
What text_replace does on Tanod
AI agents use text_replace to create or update resources in Tanod, usually the action step of a workflow, after the agent has gathered context. Every call changes real data in your Tanod environment.
| Parameter | Type | Required | Description |
|---|---|---|---|
find | string | Yes | Literal text, or an RE2 pattern (mode=regex; no backreferences or lookaround; \p{L} for letters). |
mode | string | — | literal (default: find is plain text) or regex (find is an RE2 pattern). |
text | string | Yes | The text (at most 200,000 characters). |
dot_all | boolean | — | regex: . also matches a newline. |
replace | string | Yes | Replacement; regex mode: \1..\99, \g<name>, \\ for a backslash. |
multiline | boolean | — | regex: ^ and $ match at line breaks. |
case_sensitive | boolean | — | Match letter case exactly (default true); false ignores case. |
max_replacements | integer | — | Replace at most this many matches, first to last (1-10,000, default 10,000). |
Parameters from the server's own tool schema.
Why text_replace is rated Medium
An AI agent can call text_replace faster than any human can review: one bad instruction and it creates or modifies resources in Tanod by the hundred, each call as confident as the last.
Attacks that exploit this kind of access
The rule that runs text_replace safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Tanod, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For text_replace, this is the rule to start with:
text_replace stays usable, but capped: an agent stuck in a loop can't make hundreds of changes a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Tanod, apply this rule, and every text_replace call is checked against it from then on.
Questions about text_replace
utilpeek: Find and replace in text. To sort, dedupe or number lines use text_lines. Returns the text with find replaced: literally, or as a regular expression on RE2 only (linear time for any pattern: no backtracking, so no ReDoS; backreferences and lookaround are refused), with \1 / \g<name> in the replacement; at most max_replacements (limit_reached reported). A pattern RE2 cannot compile is a 422 invalid_pattern (not charged). Typically under 0.5 s. Price: USD 0.001. Free: 10 utilpeek calls per IP per UTC day. The submitted text is never logged or stored. It is categorised as a Write tool in the Tanod MCP Server, which means it can create or modify data. Consider rate limits to prevent runaway writes.
text_replace accepts 8 parameters: find, mode, text, dot_all, replace, multiline, case_sensitive, max_replacements. Required: find, text, replace. The full parameter table on this page comes from the server's own tool schema.
Register the Tanod MCP server in PolicyLayer and add a rule for text_replace: 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 Tanod. Nothing to install.
text_replace is a Write tool with medium risk. Write tools should be rate-limited to prevent accidental bulk modifications.
Yes. Add a rate_limit block to the text_replace 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.
Set action: deny in the PolicyLayer policy for text_replace. 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.
text_replace is provided by the Tanod MCP server (https://tanod.dev/mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Tanod, and thousands of servers like it.
This server
Across the catalogue