Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
anchorYes
doc_idYes
sourceYes
tab_idYes
dry_runNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It does this thoroughly: source must be a publicly fetchable URL, local paths are rejected with IMAGE_SOURCE_UNSUPPORTED, insertion happens in a new paragraph after the anchor paragraph, dry_run previews without writing, and post-read confirmation is returned. It also discloses error conditions like SUGGESTIONS_PRESENT and REVISION_CONFLICT.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is detailed but every section earns its place: purpose, placement behavior, source constraint, dry_run, return evidence, and a structured error catalog. Critical constraints are front-loaded before return and error details, making it easy for an agent to scan.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with URL-fetching behavior and no annotations, the description is unusually complete. It covers prerequisites, anchor resolution, failure modes, recovery from REVISION_CONFLICT, pending-suggested-edits handling, and return evidence. Nothing necessary for correct invocation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for missing parameter documentation. It explains source semantics thoroughly, anchor normalization and body-text restriction, and dry_run behavior. doc_id and tab_id are not explicitly described, but their roles are inferable from the operation and sibling tool context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence names a concrete operation and target: insert an inline image after the paragraph resolved by anchor text. It clearly distinguishes this from sibling tools like append_markdown or insert_table by specifying image insertion at a resolved in-document location.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use the tool: 'Use this tool when you need to add an image to a specific location in a document tab.' It also gives important context such as dry_run for previewing and anchor resolution behavior, but it does not explicitly name alternatives or state when not to use it beyond implied constraints.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.