Skip to main content
Glama

photoshop_replace_smart_object_contents

DestructiveIdempotent

Swap the embedded image inside a Photoshop Smart Object while preserving transforms, warps, and Smart Filters. Use it to update mockups or templates with a new asset file.

Instructions

Replace the embedded contents of a Smart Object layer from an image file. Preserves transforms, warps, and Smart Filters on the layer.

Users often say: replace smart object, swap mockup screen, relink embedded file.

Use when: updating a mockup or template Smart Object with a new asset file. Do NOT use when: the target is not a Smart Object — convert first or use photoshop_place_image. Do NOT use for linked Smart Objects that need Relink to File — this replaces embedded contents.

Returns: JSON { ok, summary, details: { layer_name, file_path } }. Preconditions: Smart Object layer active or named; file_path must exist (absolute). Side effects: replaces embedded pixels.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesAbsolute path to the replacement image file (JPEG, PNG, PSD, etc.)
layer_nameNoOptional exact Smart Object layer name. Default: active layer.
document_idYesPhotoshop document id from photoshop_get_state / photoshop_list_documents. Send null or 0 to use the active document. A positive number activates that document before the tool runs. When no document is open, a stale id does not block the call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.7.33
    • changedInput schema / properties / document_id / description
      Previous value: -"Photoshop document id from photoshop_get_state / photoshop_list_documents. Send null to use the active document. A number activates that document before the tool runs."New value: +"Photoshop document id from photoshop_get_state / photoshop_list_documents. Send null or 0 to use the active document. A positive number activates that document before the tool runs. When no document is open, a stale id does not block the call."
  2. Changed4 schema fields changedv1.7.32
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / document_id / description
      Previous value: -"Optional Photoshop document id from photoshop_get_state / photoshop_list_documents. When set, the tool activates that document before running so a UI tab switch cannot retarget the edit."New value: +"Photoshop document id from photoshop_get_state / photoshop_list_documents. Send null to use the active document. A number activates that document before the tool runs."
    • changedInput schema / properties / document_id / type
      Previous value: -"number"New value: +[
      +  "number",
      +  "null"
      +]
    • changedInput schema / required
      Previous value: -[
      -  "file_path"
      -]New value: +[
      +  "file_path",
      +  "document_id"
      +]
  3. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations declare destructive=true/idempotent=true, and the description goes well beyond them: it states what is preserved (transforms, warps, Smart Filters), the side effect (replaces embedded pixels), and preconditions (active/named Smart Object, file must exist). This is exactly the non-obvious behavior an agent cannot get from the annotation flags alone.

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?

Front-loaded with the action and the preservation guarantee, then cleanly sectioned into trigger phrases, Use when / Do NOT use when, Returns, Preconditions, and Side effects. Every line carries information; no filler.

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?

With no output schema, the description supplies the return shape (JSON with ok/summary/details), preconditions, side effects, and the safety-relevant preservation behavior, so an agent has everything needed to invoke it correctly in one place.

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; the description nonetheless adds real requirement context the schema lacks — 'file_path must exist (absolute)' and 'Smart Object layer active or named' — which clarifies the required/optional parameter contract beyond the field descriptions.

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 (replace) and resource (embedded contents of a Smart Object layer) plus the source (an image file), and explicitly distinguishes itself from siblings by noting it is NOT for linked Smart Objects needing Relink and pointing at photoshop_place_image for non-Smart-Object targets.

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

Usage Guidelines5/5

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

Provides explicit 'Use when', 'Do NOT use when' clauses with named alternatives (convert first, or use photoshop_place_image), plus colloquial trigger phrases ('swap mockup screen', 'relink embedded file'). Nothing about routing is left to inference.

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