Skip to main content
Glama
PengLx
by PengLx

Preview importing a reference image

tiled_preview_import_image
Read-only

Preview an imported image as tiles on a map by resampling it onto a grid and mapping colors to the nearest palette entry, skipping fully transparent blocks.

Instructions

Resamples one project reference image onto a bounded cell grid — each cell averages its alpha-weighted pixel block — maps every cell to the nearest palette color by squared RGB distance (ties resolve to palette order), and returns an ordinary mapEdit change set carrying the setTiles writes. Fully transparent blocks are skipped, a null palette tile erases where its color wins, and palette tiles accept semantic {name} references. Pure integer arithmetic: the same image and palette always produce the same plan; a fully transparent region fails closed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
regionYes
layerIdYes
mapPathYesCanonical project-relative POSIX path; absolute paths and .. are forbidden
paletteYes
imagePathYesCanonical project-relative POSIX path; absolute paths and .. are forbidden
expectedMapRevisionYesSHA-256 revision returned by a read or preview
expectedDependencyRevisionsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

The description adds behavioral context beyond annotations: it describes deterministic behavior, handling of transparency and null tiles, and failure mode for fully transparent regions. The readOnlyHint is consistent with returning a change set (not applying it). No contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured paragraph that front-loads the main action. It is concise with no redundant information, though slightly lengthy for the level of detail.

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?

Given the output schema (not shown), the description adequately covers key behaviors and edge cases. It explains the return type (change set) and deterministic plan. However, more detail on parameter interdependencies would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is low (43%), and the description does not detail parameter meanings or constraints beyond the algorithm's overview. Parameters like region, layerId, and palette are not explained, leaving gaps for the agent.

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 title and description clearly state the tool's function: previewing the import of a reference image by resampling it onto a cell grid and converting to palette colors. It is distinct from other tiled preview tools (e.g., tiled_preview_edits, tiled_preview_shape) which handle different tasks.

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 implies usage for previewing an image import, but lacks explicit guidance on when to use this tool over alternatives, prerequisites, or when not to use it. No sibling comparisons are provided.

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/PengLx/TiledMCP'

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