# replace_all_text

Replaces EVERY occurrence of a literal string (no regex) across the whole document, or only in the tabs named by tab_ids. match_case defaults to true. Returns occurrencesChanged in the batchUpdate reply — 0 means the text was not found, not an error. Safer than replace_range for textual substitutions because it does not depend on indexes; use replace_range when position matters (e.g. only one of several occurrences).

Agent View of the PolicyLayer registry record for `replace_all_text`. HTML page: https://policylayer.com/tools/a1-x-tech-mcp-google-docs/replace-all-text

## Facts

- Tool: `replace_all_text`
- Server: Mcp Google Docs (`@a1-x-tech/mcp-google-docs`) — https://policylayer.com/tools/a1-x-tech-mcp-google-docs.md
- Install: `npx -y @a1-x-tech/mcp-google-docs`
- Homepage: https://github.com/A1-x-Tech/mcp-google-docs
- Risk category: Write (Medium risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 5 (3 required)
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `find` | string | yes | The literal text to find (no regex). |
| `replace` | string | yes | The replacement text; empty string deletes the occurrences. |
| `tab_ids` | array | no | Limit the replacement to these tabs (from list_tabs); omit for all tabs. |
| `match_case` | boolean | no | Case-sensitive matching (default true). |
| `document_id` | string | yes | The document id — the long id from the document URL (docs.google.com/document/d/<documentId>/edit) or from create_document output. |

Parameters from the server's own tool schema.

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "replace_all_text",
    "arguments": {
      "find": "<find>",
      "replace": "<replace>",
      "document_id": "<document_id>"
    }
  }
}
```

## Why replace_all_text is rated Medium

An AI agent can call replace_all_text faster than any human can review: one bad instruction and it creates or modifies resources in Mcp Google Docs by the hundred, each call as confident as the last.

Risk signals: Bulk/mass operation — affects multiple targets

## Use case

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

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Mcp Google Docs:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "replace_all_text": {
      "limits": [
        {
          "counter": "replace_all_text_rate",
          "window": "minute",
          "max": 30,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Mcp Google Docs (26)

- `delete_range` — Destructive — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/delete-range.md
- `logout` — Destructive — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/logout.md
- `manage_comment` — Destructive — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/manage-comment.md
- `start_login` — Execute — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/start-login.md
- `style_paragraph` — Execute — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/style-paragraph.md
- `auth_status` — Read — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/auth-status.md
- `get_document` — Read — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/get-document.md
- `list_comments` — Read — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/list-comments.md
- `list_tabs` — Read — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/list-tabs.md
- `raw_request` — Read — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/raw-request.md
- `read_document_text` — Read — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/read-document-text.md
- `style_text` — Read — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/style-text.md
- `create_document` — Write — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/create-document.md
- `edit_table` — Write — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/edit-table.md
- `export_document` — Write — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/export-document.md
- `finish_login` — Write — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/finish-login.md
- `import_markdown` — Write — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/import-markdown.md
- `insert_break` — Write — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/insert-break.md
- `insert_image` — Write — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/insert-image.md
- `insert_table` — Write — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/insert-table.md
- `insert_text` — Write — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/insert-text.md
- `replace_image` — Write — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/replace-image.md
- `replace_range` — Write — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/replace-range.md
- `set_client` — Write — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/set-client.md
- `set_paragraph_bullets` — Write — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/set-paragraph-bullets.md
- `setup_instructions` — Write — https://policylayer.com/tools/a1-x-tech-mcp-google-docs/setup-instructions.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=a1-x-tech-mcp-google-docs · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/a1-x-tech-mcp-google-docs
