Skip to main content
Glama

Replace an image

replace_image
DestructiveIdempotent

Replace an existing image in a Google Doc with a new image from a public URL, preserving the original size and position.

Instructions

Replaces an existing image's contents with a new image from a public URL, keeping the original's size and position (the new image is center-cropped to fit). image_object_id is the inline object id — read_document_text shows it inside [image:] placeholders, and get_document lists all ids under inlineObjects. The same URL rules as insert_image apply (public, <=50 MB, <=25 MP, PNG/JPEG/GIF).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uriYesPublic URL of the new image.
tab_idNoTab to target (from list_tabs). Omit for the first/only tab.
document_idYesThe document id — the long id from the document URL (docs.google.com/document/d/<documentId>/edit) or from create_document output.
image_object_idYesThe image's object id (from read_document_text [image:...] or get_document inlineObjects).
Behavior4/5

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

Annotations mark destructiveHint=true and readOnlyHint=false; the description confirms destructive behavior ('replaces') and adds non-obvious traits: preserving size/position and center-cropping. It also clarifies URL rules. This adds value beyond the structured annotations without contradiction.

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?

Two sentences, front-loaded with the core behavior, then the essential operational details. Every clause earns its place; no filler or redundant restating of the schema.

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?

Given no output schema, the description doesn't specify return values, but for a mutation tool that's often acceptable. It covers acquisition of the object id, URL constraints, and the transformation behavior. Slight omission is lack of error/edge-case notes (e.g., what if object id invalid), but overall it is sufficiently complete for an agent to call it correctly.

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?

Schema coverage is 100% but the description enriches every meaningful parameter: it explains how to locate image_object_id in document output and links URI requirements to an existing sibling tool (insert_image). This goes beyond the schema's terse field definitions, giving the agent operational 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?

States a specific verb ('replaces'), resource ('existing image's contents'), and distinctive behavior (center-crop to keep size/position). Clearly distinguishes from insert_image and other mutation tools at a glance.

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?

Provides clear context on how to obtain image_object_id (via read_document_text or get_document) and references insert_image for URL constraints. While it doesn't explicitly say 'use this instead of insert_image for existing images', the purpose is unambiguous, so the usage guidance is adequate though not exhaustive.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/A1-x-Tech/mcp-google-docs'

If you have feedback or need assistance with the MCP directory API, please join our Discord server