Skip to main content
Glama

Batch Process

photopea_batch_process
DestructiveIdempotent

Apply the same Photopea script to many images and export each to a target format and directory, enabling bulk resizing, conversion, or watermarking.

Instructions

Run the same edit over many images: opens each input, optionally runs a Photopea script on it, exports it to outputDir as . (repeated names get -2, -3) and closes it. Use it for bulk resizing, format conversion or watermarking. Existing files with the same name are overwritten.

Input Schema

NameRequiredDescriptionDefault
formatYesOutput format
inputsYesURLs or absolute local file paths of the images
scriptNoPhotopea JavaScript to run on each image before export, e.g. "app.activeDocument.resizeImage(800, 600);"
qualityNoCompression quality for JPG and WebP (1-100)
outputDirYesAbsolute directory path for the exported files (created if missing)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.1

TDQS

A4.1/5.0
Behavior4/5

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

Beyond destructiveHint/openWorldHint, the description discloses the two behaviors an agent most needs: existing files with the same name are silently overwritten, and repeated input names get -2, -3 suffixes. It also notes each document is closed afterward, which matters for session state. It stays silent on failure handling (what happens if one input 404s or a script throws) and on whether processing is sequential or parallel, which keeps it short of a 5.

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 compact sentences with zero filler: the core operation is front-loaded, the interpretation guidance follows, and the destructive overwrite warning comes last where it will be read. No repetition of schema fields.

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

Completeness3/5

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

There is no output schema, so the description is the only place an agent could learn the return shape — and it says nothing about whether the result is a per-file status list, exported paths, or counts. For a batch operation that can partially fail, that omission plus the silence on partial-failure semantics leaves a real gap, though the operational inputs are otherwise fully covered.

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 all five parameters are already documented (inputs accepts URLs or absolute paths, outputDir is created if missing, quality is JPG/WebP only, format is enum-constrained). The description adds one thing the schema lacks — the output filename pattern <input name>.<format> — but does not clarify ordering between inputs and outputs or how quality is ignored for png/psd. Baseline 3 is appropriate when the schema carries this much weight.

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?

"Run the same edit over many images" states a specific verb and resource, and the enumeration of the per-image lifecycle (open → optional script → export → close) makes it unmistakable from single-file siblings like photopea_open_file, photopea_export_image and photopea_run_script.

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?

"Use it for bulk resizing, format conversion or watermarking" gives concrete when-to-use conditions that map onto the available parameters. It does not explicitly state the inverse (use the single-document tools for one image, or photopea_run_script for an already-open document), so the routing guidance is implied rather than spelled out.

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