Skip to main content
Glama

photoshop_generate_from_datasets

Batch-export a Photoshop document per data set: applies each set, saves a file, repeats. Generates image variants for mail merge or personalization.

Instructions

Batch-export the active document once per data set: applies each data set, saves a copy, moves on. "Mail merge for images".

Users often say: generate all variants, batch personalize, render every row.

Use when: data sets are already imported (photoshop_import_datasets) and you want one file per row.

Returns: JSON { ok, summary, details: { exported, skipped, output_paths } }. Preconditions: active document with data sets. Side effects: writes files to output_dir.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNoOutput formatJPEG
output_dirYesDirectory for generated files (created if missing)
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.
dataset_namesNoSubset of data set names to export (default: all)

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: -[
      -  "output_dir"
      -]New value: +[
      +  "output_dir",
      +  "document_id"
      +]
  3. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations cover safety hints (readOnly=false, destructive=false, idempotent=false, openWorld=false), and the description adds real value beyond them: file-writing side effects to output_dir, the precondition of an active document with data sets, and the return payload shape. It stops short of saying whether existing files in output_dir are overwritten or how name collisions are handled.

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 core operation, then tiered into user phrasings, use-when, returns, preconditions and side effects. Every sentence carries distinct information and there is no filler.

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 a 4-param mutation tool with no output schema, the description supplies preconditions, side effects, and a return shape, which is close to complete. Minor gaps remain around overwrite/name-collision behavior and what happens to skipped rows.

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%, so the schema already documents output_dir, document_id, format, and dataset_names in detail (including null/0 active-document behavior). The description adds only the row-to-file framing and does not expand on format choices or dataset subsetting, so the baseline 3 applies.

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, resource and mechanism: batch-export one file per data set by applying each set, saving, and moving on. The 'mail merge for images' analogy plus the explicit per-row semantics distinguish it from photoshop_export_as, photoshop_export_artboards, and photoshop_recipe_batch_mockup_replace, which could otherwise look similar.

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?

Explicit 'Use when' clause names the prerequisite tool (photoshop_import_datasets) and the goal condition ('one file per row'). It also lists the user phrasings that should route here, which is directly actionable for tool selection.

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