Skip to main content
Glama

fix_image

Repairs images with garbled or glitched text by splitting into tiles, re-rendering each tile, and stitching them together for clear legibility.

Instructions

Fix an image that has glitched or garbled text by splitting it into tiles, re-rendering each tile, and stitching them back together. This works because smaller sections have less text for the model to handle at once. Use this when a generated image has text artifacts or overloaded text regions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYesFilename of the source image in /root/Pictures/pixel-surgeon
promptNoInstructions for fixing each tileClean up and fix any garbled, glitched, or distorted text in this image tile. Preserve the style, colors, and layout exactly but make all text crisp and legible.
gridNoHow to split the image: cols x rows2x2
image_sizeNoResolution for each tile1K
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.
Behavior3/5

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

No annotations provided, so description carries full burden. It explains the tiling process and why smaller sections help, but does not disclose failure modes, authentication requirements, or what happens to the original file.

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?

Three sentences front-loading the action, rationale, and use case. Every sentence earns its place with zero redundancy.

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?

No output schema, but the description covers the process and use case adequately for the tool's complexity. Could mention that the tool produces a fixed image, but not essential.

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% and schema descriptions are very detailed (e.g., model parameter includes provider tradeoffs). The main description adds little beyond repeating the tiling concept, meeting baseline.

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 uses a specific verb-reource pair ('Fix an image') and explicitly states the method (splitting into tiles, re-rendering). It distinguishes from siblings like edit_image or fix_region by focusing on garbled text and tiling approach.

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?

Directly says 'Use this when a generated image has text artifacts or overloaded text regions.' Clear context but lacks explicit when-not-to-use or alternative tool mentions beyond the implied tiling approach.

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