# insertText

Insert text at a specific index (surgical edit, doesn't replace whole file). Works on Google Docs and text/* files (e.g. text/plain, text/markdown). Index semantics differ by file type: Google Docs use the Docs API's 1-based structural position (includes structural elements); text files use a 0-based Unicode code point (character) offset into the file content. For multi-tab Google Docs, specify tabId to target a specific tab — tabId is not supported on text files.

Agent View of the PolicyLayer registry record for `insertText`. HTML page: https://policylayer.com/tools/ark7-google-drive-mcp/inserttext

## Facts

- Tool: `insertText`
- Server: Google Drive (`@ark7/google-drive-mcp`) — https://policylayer.com/tools/ark7-google-drive-mcp.md
- Install: `npx -y @ark7/google-drive-mcp`
- Homepage: https://www.npmjs.com/package/@ark7/google-drive-mcp
- Risk category: Write (Medium risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 9 (2 required)
- Recommended policy verdict: Rate-limited

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `text` | string | yes | Text to insert |
| `index` | number | no | Position to insert at. Google Docs: 1-based Docs API structural index. Text files: 0-based Unicode code point (character) offset. Provide exactly one of index o |
| `tabId` | string | no | Optional. Google Docs only — Tab ID to insert into (from listDocumentTabs). If omitted, inserts into the first/default tab. Not supported on text files. |
| `account` | string | no | Alias of the Google account to target. Optional — defaults to the session/global default account, or the sole authenticated account. Run manage_accounts list to |
| `position` | string | no | Insert before or after the matched text (default: after). Only used with textToFind. |
| `documentId` | string | yes | The Google Doc or text file ID |
| `textToFind` | string | no | Google Docs only: locate the insertion point by text instead of index (exact, case-sensitive match). Combine with position (before/after) and matchInstance. If |
| `ifRevisionId` | string | no | Optional optimistic lock: a revisionId from readGoogleDoc, getGoogleDocContent, getGoogleDocContentPaginated, or getDocumentInfo. The write fails cleanly if the |
| `matchInstance` | number | no | Which instance of textToFind (default: 1) |

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": "insertText",
    "arguments": {
      "text": "<text>",
      "documentId": "<documentId>"
    }
  }
}
```

## Why insertText is rated Medium

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

## Use case

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

## Recommended policy (PolicyLayer)

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

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

## Other tools on Google Drive (130)

- `deleteCalendarEvent` — Destructive — https://policylayer.com/tools/ark7-google-drive-mcp/deletecalendarevent.md
- `deleteComment` — Destructive — https://policylayer.com/tools/ark7-google-drive-mcp/deletecomment.md
- `deleteDimensionGroup` — Destructive — https://policylayer.com/tools/ark7-google-drive-mcp/deletedimensiongroup.md
- `deleteGoogleSlide` — Destructive — https://policylayer.com/tools/ark7-google-drive-mcp/deletegoogleslide.md
- `deleteItem` — Destructive — https://policylayer.com/tools/ark7-google-drive-mcp/deleteitem.md
- `deleteRange` — Destructive — https://policylayer.com/tools/ark7-google-drive-mcp/deleterange.md
- `deleteSheet` — Destructive — https://policylayer.com/tools/ark7-google-drive-mcp/deletesheet.md
- `deleteSlideElement` — Destructive — https://policylayer.com/tools/ark7-google-drive-mcp/deleteslideelement.md
- `removePermission` — Destructive — https://policylayer.com/tools/ark7-google-drive-mcp/removepermission.md
- `authGetStatus` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/authgetstatus.md
- `authListScopes` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/authlistscopes.md
- `authTestFileAccess` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/authtestfileaccess.md
- `describeGoogleDocRange` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/describegoogledocrange.md
- `downloadFile` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/downloadfile.md
- `exportSlideThumbnail` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/exportslidethumbnail.md
- `getCalendarEvent` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/getcalendarevent.md
- `getCalendarEvents` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/getcalendarevents.md
- `getComment` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/getcomment.md
- `getDocumentInfo` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/getdocumentinfo.md
- `getGoogleDocContent` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/getgoogledoccontent.md
- `getGoogleDocContentPaginated` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/getgoogledoccontentpaginated.md
- `getGoogleDocImage` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/getgoogledocimage.md
- `getGoogleDocStyleSummary` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/getgoogledocstylesummary.md
- `getGoogleSheetCells` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/getgooglesheetcells.md
- `getGoogleSheetContent` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/getgooglesheetcontent.md
- `getGoogleSlidesContent` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/getgoogleslidescontent.md
- `getGoogleSlidesSpeakerNotes` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/getgoogleslidesspeakernotes.md
- `getRevisions` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/getrevisions.md
- `getSlideElementInfo` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/getslideelementinfo.md
- `getSpreadsheetInfo` — Read — https://policylayer.com/tools/ark7-google-drive-mcp/getspreadsheetinfo.md
- …and 100 more: https://policylayer.com/tools/ark7-google-drive-mcp.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=ark7-google-drive-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/ark7-google-drive-mcp
