Skip to main content
Glama
pdf4me
by pdf4me

compress_image

Reduce image file size by compressing JPG, PNG, or WebP images. Choose compression level to control quality versus size.

Instructions

Compress an image via PDF4me CompressImage (/api/v2/CompressImage). image_file_path, image_type (JPG, PNG, WebP), compression_level (Max, Medium, Low); optional doc_name, output_dir, output_file_name. Uses async 202 polling when applicable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_nameNo
image_typeNoJPG
output_dirNo
image_file_pathYes
output_file_nameNo
compression_levelNoMedium
Behavior3/5

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

With no annotations, the description carries the burden of disclosing behavior. It mentions 'Uses async 202 polling when applicable,' which is a useful operational detail. However, it does not disclose whether the original file is overwritten, what the return value is, or any side effects. The optional output parameters imply file creation, but this is not explicitly stated.

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 concise, using two sentences to convey purpose, parameters, and a notable behavioral aspect. It is front-loaded with the core action and avoids redundancy. No unnecessary words.

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 tool has 6 parameters, no output schema, and no annotations. The description covers the API endpoint, parameters, and async polling, but fails to explain the return value or the behavior of the optional output parameters. It is adequate but leaves gaps that an agent would need to infer or test.

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 0%, so the description must compensate. It lists all parameters and provides enum values for image_type and compression_level, which adds meaning beyond the bare schema. However, it does not explain the semantics of doc_name, output_dir, or output_file_name beyond calling them 'optional', leaving their purpose ambiguous.

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 the tool's function: 'Compress an image via PDF4me CompressImage'. It specifies the verb ('compress') and resource ('image'), and includes the API endpoint. This distinguishes it from sibling tools like resize_image or convert_image_format.

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 does not explicitly state when to use this tool over alternatives, nor does it name any alternative tools. However, the purpose is obvious from the name and description, implying usage for image compression. The mention of 'async 202 polling' gives a hint about behavior but no explicit guidance on when this applies.

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/pdf4me/pdf4me-mcp'

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