Skip to main content
Glama
LxyMp
by LxyMp

compress_image

Compress local images to reduce file size for transmission or recognition. Supports scaling by width or compressing to a target file size without exceeding it.

Instructions

压缩本地图片文件,缩小体积便于传输或识别。依赖 macOS sips 命令。支持两种模式:(1) 按宽度缩放(默认 800px);(2) 按目标文件大小压缩(如 "1M"),使用迭代二分逼近算法严格控制在不超出目标大小。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageYes本地图片的绝对路径
maxSizeNo目标文件大小限制,例如 "1M"(1MB)、"500KB"、 "200K"。指定后会自动迭代压缩至目标大小以内,绝不超出。不传则按 maxWidth 缩放。
maxWidthNo最大宽度像素(默认: 800)。仅在不指定 maxSize 时生效。
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the macOS sips dependency and the iterative binary approximation algorithm for size control, which are valuable. However, it omits whether the original file is modified or a new file created, supported formats, and error behavior in case of failure.

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 extremely concise: two sentences covering all key aspects without fluff. It uses bullet-point-style enumeration for clarity and prioritizes the most important usage modes prominently.

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?

The description lacks information about the return value or output (e.g., path to compressed file), acceptable formats, and side effects. Given no output schema, the description should fill this gap to be fully complete for an agent.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3. The description adds value beyond the schema by explaining the default width (800px), the target size format (e.g., '1M'), and the iterative algorithm for maxSize. This enriches parameter understanding without being redundant.

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 it compresses local image files, names the dependency (macOS sips), and enumerates two distinct modes: width-based and target-size-based. This specificity distinguishes it from sibling tools like 'describe_image' which serves a different purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides guidance on when to use each mode (maxWidth vs maxSize) but does not explicitly contrast with sibling tools or state when to choose compression over other operations. The context is clear for the tool's internal options but lacks tool-selection guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/LxyMp/vision-for-reasonix'

If you have feedback or need assistance with the MCP directory API, please join our Discord server