Skip to main content
Glama

cocos_screenshot_preview_diff

Compare PNG screenshots to detect visual changes and verify UI actions in Cocos Creator. Analyze pixel differences between before and after images to confirm whether interactions produce visible effects.

Instructions

Compare two PNG files on disk and report the change.

Lets an AI confirm whether an action actually DID something — e.g. take a screenshot, click, take another, diff: if diff_ratio is ~0 the click had no visible effect.

threshold is a per-channel absolute delta; pixels below are considered identical (8 rejects typical PNG compression noise).

Returns {width, height, total_pixels, different_pixels, diff_ratio} where diff_ratio is in [0, 1].

This tool is pure Pillow — it does NOT need playwright / chromium installed. Both inputs must be file paths; save via cocos_screenshot_preview first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
before_png_pathYes
after_png_pathYes
thresholdNo
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key traits: it's a read-only comparison tool (implied by 'report the change'), explains the threshold parameter's role in handling PNG compression noise, details the return format with specific metrics, and clarifies dependencies (Pillow-based, no playwright/chromium). It doesn't mention error handling or performance limits, but covers core behavior well for a tool with no annotations.

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?

The description is well-structured and efficiently packed. It starts with the core purpose, provides a practical use case example, explains the threshold parameter, details the return format, and ends with implementation notes. Each sentence adds value without redundancy, and the information is front-loaded with the most important details first.

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 tool's moderate complexity (3 parameters, no annotations, no output schema), the description is quite complete. It covers purpose, usage context, parameter semantics, return values, and implementation details. The only minor gap is the lack of explicit error cases or limitations documentation, but for a comparison tool with clear parameters and return format, it provides sufficient context for effective use.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully compensate. It adds significant meaning beyond the schema: explains that 'before_png_path' and 'after_png_path' are file paths for PNG screenshots, clarifies that 'threshold' is 'a per-channel absolute delta; pixels below are considered identical (8 rejects typical PNG compression noise)' with a default value context, and notes both inputs are required. This provides complete parameter understanding despite the schema's lack of descriptions.

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's purpose: 'Compare two PNG files on disk and report the change.' It specifies the resource (PNG files) and verb (compare and report), and distinguishes itself from sibling tools by focusing on image comparison rather than scene manipulation or asset creation. The example use case further clarifies its role in confirming visual changes.

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?

The description provides clear context for when to use the tool: to confirm whether an action had a visible effect by comparing screenshots before and after. It mentions prerequisites ('Both inputs must be file paths; save via cocos_screenshot_preview first') and notes it's 'pure Pillow — it does NOT need playwright / chromium installed,' which helps differentiate it from other screenshot-related tools. However, it doesn't explicitly state when NOT to use it or name specific alternatives among siblings.

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/chenShengBiao/cocos-mcp'

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