Skip to main content
Glama

Trim

photopea_trim
DestructiveIdempotent

Trim empty borders from the active document by removing transparent pixels or corner-matching colors. Useful after background removal or before exporting icons.

Instructions

Trim empty borders from the active document: transparent pixels, or pixels matching the top-left or bottom-right corner color. Useful after removing a background or before exporting an icon.

Input Schema

NameRequiredDescriptionDefault
basisNoWhat counts as empty bordertransparent

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.1

TDQS

A3.8/5.0
Behavior3/5

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

The annotations already declare destructiveHint=true, idempotentHint=true, and readOnlyHint=false, so the safety profile is known. The description adds the pixel-selection semantics of the trim, but it does not state whether the result can be undone, what happens when there is no empty border, or whether hidden layers count.

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?

It is one compact sentence: it front-loads the action and the scope, and it ends with the practical use case. It contains no redundant or filler wording.

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 one-optional-parameter tool with rich annotations and no output schema, the description is nearly complete: it explains the operation and when to use it. It leaves only minor edge-case behavior (no-op result, undoability, layer scope) unstated.

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 coverage is 100%, and the single enum parameter already carries its own description, so the baseline is 3. The description restates the three enum options in plain language ('transparent pixels, or pixels matching the top-left or bottom-right corner color'), which adds only slight clarity beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a specific verb and resource ('Trim empty borders from the active document') and spells out precisely what counts as an empty border. It never names a sibling, so an agent must infer on its own why this differs from photopea_crop or photopea_resize_canvas, even though the phrase 'empty borders' implies the distinction.

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?

The description states concrete usage contexts ('Useful after removing a background or before exporting an icon'), which lets an agent judge fit without opening the schema. It does not explicitly exclude alternatives or tell the agent when to choose photopea_crop instead.

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