Skip to main content
Glama

fix_region

Crop and repair a specific region of an image where text is garbled or distorted. Automatically snaps to supported aspect ratio for precise fixes.

Instructions

Fix a specific region of an image by cropping it out, sending it for repair, and reinserting it. The crop is automatically snapped to the nearest supported aspect ratio. Use this when only part of an image has glitched text or artifacts — more precise than fix_image's grid approach.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYesFilename of the source image in /root/Pictures/pixel-surgeon
promptNoInstructions for fixing the selected regionClean up and fix any garbled, glitched, or distorted text in this image region. Preserve the style, colors, and layout exactly but make all text crisp and legible.
xYesLeft edge of region as percentage of image width (0-100)
yYesTop edge of region as percentage of image height (0-100)
widthYesWidth of region as percentage of image width (1-100)
heightYesHeight of region as percentage of image height (1-100)
image_sizeNoResolution for the cropped region1K
modelNoModel to use. Available: 'gemini-3.1-flash-image' (Gemini 3.1 Flash Image), 'gemini-2.5-flash-image' (Gemini 2.5 Flash Image), 'gpt-image-1' (GPT Image 1 (OpenAI)), 'gpt-image-2' (GPT Image 2 (OpenAI)), 'grok-imagine' (Grok Imagine (xAI)). Default: 'gpt-image-2'. Set DEFAULT_IMAGE_MODEL env var to change the default. Provider tradeoffs: grok-imagine is fastest and cheapest; gemini is mid-quality with the best price/performance ratio (free tier available); gpt-image-2 is highest quality but slower and more expensive. Gemini models fall back to free tier on billing errors. OpenAI requires OPENAI_API_KEY. Grok requires XAI_API_KEY.
Behavior4/5

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

Discloses cropping and snapping to nearest aspect ratio, and model tradeoffs in parameter description. However, no annotations exist, and it omits details like destructive nature, rate limits, or authentication requirements.

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 plus parameter table; front-loaded with purpose and usage. Every part is informative, no fluff.

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?

Covers purpose, when to use, and key behavioral aspects. Lacks output description and error handling, but sufficient given tool complexity and parameter clarity.

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 covers all parameters with descriptions (100% coverage). The description adds minimal extra beyond schema; model parameter has detailed tradeoffs within schema, so baseline 3.

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?

Clearly states it fixes a region of an image by cropping, repairing, and reinserting. Distinguishes from fix_image's grid approach, saying it's more precise for partial glitches.

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 advises using it when only part of an image has glitched text or artifacts, and contrasts with fix_image. Provides clear when-to-use and alternative.

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/j-east/pixel-surgeon-mcp'

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