Skip to main content
Glama

预览图片压缩

prepare_compression
Read-only

Generate a visually lossless compression plan for JPEG, PNG, WebP, AVIF, GIF, or SVG files without altering originals; returns plan_id and preview for user approval.

Instructions

视觉无损压缩图片(JPEG/PNG/WebP/AVIF/GIF/SVG),结果存放在临时目录,不修改原图。返回 plan_id 和预览表。必须把预览表完整展示给用户,并在用户明确同意后才能调用 apply_compression。

Input Schema

NameRequiredDescriptionDefault
pathsYes图片文件或目录路径,建议使用绝对路径
effortNofast:跳过质量判定;balanced:默认;max:更高压缩率、更慢balanced
min_scoreNoSSIMULACRA2 及格线,85 为视觉无损
recursiveNo是否递归子目录

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

readOnlyHint=true is already declared, but the description adds real behavior the annotation cannot: output lands in a temp directory, the original files are untouched, and the call yields a plan_id plus a preview table. It does not cover failure modes or how long the plan_id remains valid, so not a full 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 tight sentences: capability and safety first, return values next, mandatory workflow constraint last. No repetition of the title or schema, and nothing padding.

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 two-phase prepare/apply workflow with no output schema, the description supplies the return contract (plan_id + preview table) and the human-approval gate, which is what an agent most needs. Minor gaps remain around plan expiry or preview-table scale limits.

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 the schema already documents paths, effort, min_score, and recursive in detail (including the SSIMULACRA2 threshold and enum meanings). The description adds no parameter-level information, 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 ('视觉无损压缩图片') plus supported formats and output location (临时目录, 不修改原图). It also names the sibling it hands off to (apply_compression), so an agent can distinguish it from apply_compression and cancel_compression without opening a schema.

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 sequencing rules: the preview table must be shown to the user in full, and apply_compression may only be called after the user's explicit consent. That is a when-to-use and when-not-to-use condition paired with the named alternative.

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