Skip to main content
Glama
LxyMp
by LxyMp

compress_image

Compress local images to reduce file size for easier transmission or recognition. Supports resizing by width or compressing to a target file size using iterative approximation.

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, so description must provide behavioral insight. It reveals the macOS dependency and the iterative algorithm for size control. However, it does not specify output file location, whether the file is modified in-place, or error behavior, leaving some transparency gaps.

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?

Extremely concise: two sentences cover purpose, dependency, and two operation modes. No redundant words. Front-loaded with key info.

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?

For a tool with 3 parameters and no output schema or annotations, the description covers purpose, modes, and dependency well. However, it omits critical details like output behavior (where the compressed file goes, naming convention), error handling, and permission requirements. This moderate gap reduces completeness.

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 the schema already documents the three parameters. The description adds value by explaining the iterative algorithm for maxSize, the default for maxWidth, and the interaction between parameters (maxSize takes precedence). This goes beyond the schema.

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 to reduce size, and details two specific modes (width scaling and target file size) with a concrete default. It distinguishes from sibling tools like describe_image.

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?

Provides clear context: depends on macOS sips command, and specifies when to use each mode. While it doesn't explicitly state when not to use, the two-mode guidance is sufficient. No alternative tools mentioned, but siblings are listed separately.

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/reasonix-vision-mcp'

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