Skip to main content
Glama

insert_inline_image

Destructive

Insert an inline image at a specific index in a Google Doc using an HTTPS URL or Drive file ID, with optional width and height. Use document structure to choose the insertion index.

Instructions

Insert an inline image at a specific index in a Google Doc.

Provide either uri (a publicly accessible HTTPS image URL) or drive_file_id (a Drive file ID for an image stored in Drive). The image is inserted at the given document index.

Use get_doc_structure to find a suitable insertion index.

Args: doc_id: The Google Doc file ID. index: Document body index where the image should be inserted. uri: A publicly accessible image URI (HTTPS). Mutually exclusive with drive_file_id. drive_file_id: A Google Drive file ID for an image stored in Drive. The Docs backend fetches the image over HTTP as an anonymous request, so the file must be shared as anyone-with-link (e.g. via share_file with {"type": "anyone", "role": "reader"}) — being accessible to the authenticated user alone is not sufficient and fails with "There was a problem retrieving the image" (confirmed live 2026-07-18). Mutually exclusive with uri. width: Optional image width in points. height: Optional image height in points. auto_downscale: Google Docs rejects any inline image over ~25 megapixels or ~50MB. When drive_file_id is provided and Drive's own reported dimensions or file size exceed either limit, the default (False) fails fast with a clear error naming the limit and the image's actual size — before ever calling the Docs API. Set True to instead resize it and embed the resized copy: the original Drive file is left untouched, a new file named " (resized)" is created alongside it and shared anyone:reader, and its own fileId is returned as resized_file_id. Ignored when uri is used instead of drive_file_id — there's no local copy of a bare uri to resize; an oversized uri source instead fails with a rewritten error explaining the likely cause, since pre-validating or re-hosting arbitrary external content is out of scope here (see docs/decisions/decision- pillow-image-dependency.md).

Returns: Confirmation with docId and the insertion index. Also includes resized_file_id if drive_file_id was resized under auto_downscale, on an error result too, since the resized copy exists either way.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "doc_id": "<doc_id>",
      "index": "<index>"
    },
    "name": "insert_inline_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
uriNo
indexYes
widthNo
doc_idYes
heightNo
drive_file_idNo
auto_downscaleNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.6

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the destructiveHint annotation, the description explains the non-obvious sharing requirement for drive_file_id, the auto_downscale behavior including resized-copy creation and returned resized_file_id, and URI failure behavior. This is exactly the kind of behavioral context an agent needs before invoking a mutation tool.

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

Conciseness4/5

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

The definition is front-loaded with purpose and mutually exclusive source parameters, then uses Args/Returns structure effectively. Some details, such as the decision-doc reference and the 'confirmed live 2026-07-18' note, are not essential for invocation and could be trimmed.

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?

Given the tool's complexity, seven parameters, mutation behavior, and image-size handling, the description covers all parameters, error cases, return values, and prerequisite structure lookup. Nothing an agent needs to call it correctly is missing.

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

Parameters5/5

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

With 0% schema description coverage across seven parameters, the description fully compensates by documenting doc_id, index, uri, drive_file_id, width, height, and auto_downscale. It adds crucial semantics such as mutual exclusivity between uri and drive_file_id, the anyone-with-link sharing requirement, and auto_downscale's default and side effects.

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 description states a specific verb, resource, and location: 'Insert an inline image at a specific index in a Google Doc.' This clearly distinguishes it from text, table, or page-break insertion siblings and scopes it to inline images within a document.

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?

It explicitly tells the agent to use get_doc_structure to find a suitable insertion index, giving clear prerequisite guidance. However, it does not explicitly compare this tool with insert_local_images or other image-insertion alternatives, so the selection context is clear but not exhaustive.

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

Deploy Server

Other Tools