insert_image
Insert an inline image after specific text in a Google Doc by providing a public image URL and anchor text, with dry run to verify placement before writing.
Instructions
Insert an inline image after the paragraph containing anchor text.
Use this tool when you need to add an image to a specific location in a document tab. The anchor resolves via the same normalization ladder as replace_text (exact → curly/straight quotes → NBSP/whitespace → soft-hyphen). The image is inserted as an inline object in a new paragraph immediately after the paragraph containing the resolved anchor.
source must be a publicly fetchable URL (http/https). Local file paths are rejected with IMAGE_SOURCE_UNSUPPORTED — the Docs API fetches the image from the URL directly and cannot access local files.
Set dry_run=true to preview the resolved anchor position without writing.
Returns structural evidence: applied, revision_before/after, inline_object_confirmed (whether the post-read confirms an inline object near the anchor paragraph), audit_logged.
Errors: QUOTE_NOT_FOUND – anchor not found; nearest candidates listed IMAGE_SOURCE_UNSUPPORTED – source is a local path, not a URL INVALID_INPUT – anchor is inside a table (anchor must be body text) TAB_NOT_FOUND – tab_id not in document REVISION_CONFLICT – document changed mid-call; re-read and retry SUGGESTIONS_PRESENT – tab has pending suggested edits; accept/reject them in the Docs UI first, then retry
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| anchor | Yes | ||
| doc_id | Yes | ||
| source | Yes | ||
| tab_id | Yes | ||
| dry_run | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||