Skip to main content
Glama

Process Image

process_image

Process an existing image locally by cropping, resizing, removing background, converting format, or trimming whitespace. Free and fast with no API calls.

Instructions

Process an existing image locally using sharp. Crop, resize, remove background, convert format, or trim whitespace. Free, fast, no API calls. For AI-powered editing (style changes, complex background removal), use generate_image with the image as input instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imagePathYesPath to the image file to process
cropNoCrop image. Use width+height for pixel-exact, or aspectRatio for ratio-based. Strategy controls where to crop from.
resizeNoResize image. Maintains aspect ratio if only width or height given.
removeBackgroundNoRemove background. Use threshold for white backgrounds, or color for chroma key (green screen).
trimNoAuto-trim whitespace borders
formatNoConvert to format. Defaults to original format.
qualityNoOutput quality for JPEG/WebP (1-100). Default 90.
outputDirNoDirectory to save. Defaults to config file outputDir, OUTPUT_DIR env var, or ~/gemini-images
filenameNoBase name for saved file. Auto-versioned if duplicate.
subfolderNoSubfolder within output directory
Behavior3/5

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

No annotations provided, so description carries burden. It mentions 'Free, fast, no API calls' and local processing with sharp, but does not disclose key behaviors like whether original file is mutated, default output behavior, or side effects (e.g., saving to outputDir). Some transparency, but gaps remain.

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?

Two sentences front-loaded with purpose and capabilities, then alternative. No wasted words, efficient and clear.

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?

Given 10 parameters with nested objects and no output schema, the description is brief. It lacks details on return values, output paths, or processing behavior beyond the schema. While schema is thorough, the description could provide more operational context.

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% (all parameters described in detail). Description provides a high-level list of operations but does not add meaning beyond the schema for individual parameters. Baseline 3 is appropriate.

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 processes an existing image locally using sharp, listing specific operations (crop, resize, remove background, etc.). It distinguishes from the sibling generate_image by noting AI-powered editing should use that alternative.

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?

Explicitly tells when to use this tool (free, fast, local, no API calls) and when not to (for AI-powered editing), naming the alternative tool generate_image.

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/JimothySnicket/gemini-image-mcp'

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