Skip to main content
Glama

insertImage

Insert an inline image into a Google Doc from a public URL or local file path, uploading local files to Drive first. Specify the document ID and character index for placement.

Instructions

Inserts an inline image into a Google Document. Provide either a publicly accessible URL or a local file path. Local files are automatically uploaded to Google Drive before insertion.

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": {
      "documentId": "<documentId>",
      "index": "<index>"
    },
    "name": "insertImage"
  }
}

Input Schema

NameRequiredDescriptionDefault
indexYes1-based character index in the document body where the image should be inserted. Use readDocument with format='json' to inspect indices.
tabIdNoThe ID of the specific tab to insert into. Use listDocumentTabs to get tab IDs. If not specified, inserts into the first tab.
widthNoWidth of the image in points.
heightNoHeight of the image in points.
imageUrlNoPublicly accessible URL to the image (http:// or https://).
documentIdYesThe document ID — the long string between /d/ and /edit in a Google Docs URL.
readHandleNoCapability returned by a previous readDocument call for this document (and tab). Required over HTTP on the 2026-07-28 runtime: it authorizes the write and pins it to the revision that read saw. Omit it on stdio to use that connection's most recent read.
localImagePathNoAbsolute path to a local image file (supports .jpg, .jpeg, .png, .gif, .bmp, .webp, .svg). The file will be uploaded to Google Drive.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.0.0-rc.1

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does disclose a meaningful side effect: local files are automatically uploaded to Google Drive before insertion. That is real behavioral context an agent would not otherwise know. It omits permission requirements and what happens to existing document content at the insertion index, so it is strong but not exhaustive.

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?

Three short sentences with zero waste: the operation is stated first, then the input options, then the side effect. Nothing is redundant and the most decision-relevant information is front-loaded.

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

Completeness4/5

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

For an 8-parameter mutation tool with no annotations and no output schema, the description covers the essential points: what it does, the two image sources, and the Drive upload side effect. The remaining gaps — permission needs, error conditions on an invalid index, and whether surrounding text shifts — are modest but real for a write operation.

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 coverage is 100%, so the baseline is 3, and the description earns above that by declaring that imageUrl and localImagePath are alternative input modes — a mutual-exclusivity relationship the schema itself does not state. It does not add detail on width/height behavior or readHandle beyond what the schema already documents.

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?

States a specific verb and resource — 'Inserts an inline image into a Google Document' — which immediately distinguishes it from sibling insertion tools like insertChart, insertTable, and insertPageBreak. The second sentence clarifies the accepted input sources, so an agent knows exactly what operation it is invoking.

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 gives clear calling context by stating that either a publicly accessible URL or a local file path must be provided, which resolves the main ambiguity in how to invoke it. It stops short of stating when to prefer this tool over siblings or when not to use it (e.g., replacing an existing image), so no explicit exclusions are present.

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