Skip to main content
Glama

reference

Read a picture the page must match, inspect cropped pixels, grid coordinates and sample colors, then compare the open page's render against it.

Instructions

Reads a reference picture the page should match (a photo, artwork, mockup or screenshot in the project, e.g. refs/01.jpg) at full resolution, in one call and with no page open: crop [left, top, right, bottom] in the picture's pixels, enlarged up to 4× to fit 1280 px, with grid lines every N px labelled in the picture's own pixel coordinates (positions read off it go straight into the next call or the scene), and sample points, each answered as #rrggbb. With the page open, compare: true puts the picture, the page's look (from camera when given) and a difference picture side by side and says what share of pixels differ, overall and in a grid of regions (cells per side, 4 by default), with each sample point's colour on both, or that the canvas aspect is not the picture's. Use it to read a picture the page should match and to check the page against it.

Input Schema

NameRequiredDescriptionDefault
cwdYesThe game project's folder.
cropNo[left, top, right, bottom] in the picture's pixels ([x, y, width, height] is read as such when right < left or bottom < top), trimmed to the picture; the whole picture when left out. With compare: that region of the picture and the same region of the page, enlarged side by side with their differences.
fileYesThe picture's path, relative to cwd, or the name of a baseline saved with look { save } (compare the page with its earlier look).
gameNoThe name the game was opened under with the `open` tool, to act on ("main" by default; a subagent uses its own).
gridNoGridline spacing in the picture's pixels (100 on a whole picture, 10 to 50 on a crop); none when left out.
cellsNoRegions per side for compare's differing-share grid (4 by default).
cameraNoFor compare: the page's look from this position (looking at lookAt) or from a camera by name, as `look`'s camera; left out, the picture's entry in refs/cameras.json when there is one, else the page's own camera.
sampleNoPoints [x, y] in the picture's pixels whose colour to return (the mean of 5 × 5 pixels); with compare, the page's colour at the same point too.
compareNoPut the open page's look beside the picture with their differences; needs `open` first, and a canvas with the picture's aspect for the pixel comparison.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and discloses substantial behavior: full-resolution reading, one-call/no-page-open operation, crop enlargement up to 4× to fit 1280 px, grid lines labeled in the picture's own pixel coordinates, sample points answered as #rrggbb, and compare output including differing-pixel share and aspect-mismatch reporting. It does not explicitly state that the tool is read-only or describe error behavior, but the reading-oriented behavior is well covered.

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

Conciseness3/5

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

The description is front-loaded with the core purpose, and every clause is relevant to using the tool. However, it is a dense run-on with deeply nested parentheticals, making it harder to scan than a more structured presentation would be.

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?

This is a complex nine-parameter tool with no output schema and no annotations, and the description covers the important modes, return information for sample and compare, prerequisites, and limitations such as aspect mismatch. It is largely complete, though it could be clearer about file formats or error conditions.

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 100%, and all nine parameters are already well documented in the schema. The description adds some useful context, such as the 4× enlargement limit and the fact that grid coordinates feed directly into later calls or the scene, but most parameter semantics are restated from the schema rather than adding new meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: it reads a reference picture the page should match, at full resolution. It distinguishes this from reading the page itself by describing the picture as the thing the page should match, but it never names close siblings such as look, observe, or model_look to make the routing explicit.

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?

It gives a clear usage context: use it to read a picture the page should match and to check the page against it. It also states the condition for compare mode (the page must be open and the canvas must have the picture's aspect), but it does not name alternatives or say when not to use this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.