Skip to main content
Glama

photoshop_replace_smart_object_contents

Update a Smart Object layer's embedded contents from an image file while preserving transforms, warps, and Smart Filters. Use to swap mockup screens or relink embedded files.

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_idNoOptional 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral disclosure burden. It states side effects ('replaces embedded pixels'), preservation behavior ('Preserves transforms, warps, and Smart Filters'), and preconditions ('Smart Object layer active or named; file_path must exist'). It also provides the return shape, giving the agent a clear model of the operation.

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 well-structured and front-loaded with the core purpose, followed by usage rules, return format, preconditions, and side effects. Even the 'Users often say' line adds search-friendly synonyms without bloating the content.

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?

The description is complete for a tool of this complexity: it explains what happens, what is preserved, when to use it, when not to use it, what the output looks like, and what conditions must hold before invocation. There is no output schema, so the inclusion of the return JSON contract is especially valuable.

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

Parameters3/5

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

Schema description coverage is 100%, and each parameter already has a detailed schema description including defaults and provenance for document_id. The description adds a global precondition tying layer and file_path together, but does not significantly enrich individual parameter semantics beyond the schema.

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 clearly states a specific action and resource: 'Replace the embedded contents of a Smart Object layer from an image file.' It immediately distinguishes itself by noting what it preserves (transforms, warps, Smart Filters) and explicitly contrasts it with photoshop_place_image and linked Smart Object relinking.

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?

The description provides explicit 'Use when' and 'Do NOT use when' guidance, naming concrete alternatives such as photoshop_place_image and 'Relink to File' for linked Smart Objects. This leaves no ambiguity about when the tool should be selected versus its siblings.

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