Skip to main content
Glama

reviewEdit

Compare 'before' and 'after' screenshots of a UI edit request to determine if changes meet the user's requirements. Receive a yes/no response with detailed feedback for further adjustments if needed.

Instructions

Perform a visual review of a UI edit request. The 'before screenshot' is a screenshot of the page before the edit, and the 'after screenshot' is the screenshot of the page after the edit. You will recieve either a yes or no response, indicating whether the edit visually satisfies the edit request. If no, it will provide a detailed explanation of why the edit does not satisfy the request so you can continue to work on it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterScreenshotPathYesAbsolute path to the 'after' screenshot file (png)
beforeScreenshotPathYesAbsolute path to the 'before' screenshot file (png)
editRequestYesA detailed description of the UI edit request made by the user. Do not describe the changes you made, but just summarize what the user asked you to change on the page.

Implementation Reference

  • The handler function registered for the 'reviewEdit' MCP tool. It reads the before and after screenshots from disk as base64, calls the reviewScreenshots helper with the API key and optional model, and returns the result as MCP content or error.
    async ({ beforeScreenshotPath, afterScreenshotPath, editRequest }) => {
    	try {
    		// Read image files from disk
    		const beforeScreenshot = await fs.readFile(beforeScreenshotPath, {
    			encoding: "base64"
    		})
    		const afterScreenshot = await fs.readFile(afterScreenshotPath, {
    			encoding: "base64"
    		})
    
    		// Call the review function with API key and model (if provided)
    		const reviewResult = await reviewScreenshots(
    			beforeScreenshot,
    			afterScreenshot,
    			editRequest,
    			apiKey,
    			model
    		)
    
    		return {
    			content: [
    				{
    					type: "text",
    					text: reviewResult
    				}
    			]
    		}
    	} catch (error: unknown) {
    		console.error("Error processing screenshots:", error)
    		const errorMessage =
    			error instanceof Error ? error.message : String(error)
    		return {
    			content: [
    				{
    					type: "text",
    					text: `Error processing screenshots: ${errorMessage}`
    				}
    			]
    		}
    	}
    }
  • Zod input schema for the 'reviewEdit' tool defining parameters: beforeScreenshotPath, afterScreenshotPath, and editRequest.
    {
    	beforeScreenshotPath: z
    		.string()
    		.describe("Absolute path to the 'before' screenshot file (png)"),
    	afterScreenshotPath: z
    		.string()
    		.describe("Absolute path to the 'after' screenshot file (png)"),
    	editRequest: z
    		.string()
    		.describe(
    			"A detailed description of the UI edit request made by the user. Do not describe the changes you made, but just summarize what the user asked you to change on the page."
    		)
    },
  • src/index.ts:40-42 (registration)
    Registration of the 'reviewEdit' tool on the MCP server with name, description, schema, and handler.
    server.tool(
    	"reviewEdit",
    	"Perform a visual review of a UI edit request. The 'before screenshot' is a screenshot of the page before the edit, and the 'after screenshot' is the screenshot of the page after the edit. You will recieve either a yes or no response, indicating whether the edit visually satisfies the edit request. If no, it will provide a detailed explanation of why the edit does not satisfy the request so you can continue to work on it.",
  • Supporting helper function that invokes the vlm vision-language model with the screenshots, edit request, default system prompt, API key, and optional model.
    export async function reviewScreenshots(
    	beforeScreenshot: string,
    	afterScreenshot: string,
    	editRequest: string,
    	apiKey: string,
    	model?: string
    ) {
    	const response = await vlm({
    		beforeImage: beforeScreenshot,
    		afterImage: afterScreenshot,
    		systemPrompt: defaultSystemPrompt,
    		editRequest,
    		apiKey,
    		model
    	})
    
    	return response
    }
Behavior3/5

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

With no annotations provided, the description carries full behavioral disclosure burden. It describes the core behavior (visual review returning yes/no with explanations) and the iterative nature ('continue to work on it'). However, it doesn't disclose important behavioral traits like processing time, file size limitations, authentication needs, error conditions, or what constitutes a valid screenshot.

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 appropriately sized (3 sentences) and front-loaded with the core purpose. Each sentence adds value: first states purpose, second explains parameters, third describes outcomes. There's minimal redundancy, though the second sentence could be slightly more concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter tool with no annotations and no output schema, the description provides adequate but incomplete context. It covers the basic workflow and outcome format but lacks details about error handling, performance characteristics, or what specific visual criteria are used for evaluation. The absence of output schema means the description should ideally explain return values more thoroughly.

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%, providing complete parameter documentation. The description adds minimal value beyond the schema: it clarifies that screenshots represent 'before' and 'after' states and mentions the edit request context. However, it doesn't provide additional semantic context about parameter relationships or usage nuances beyond what's already in the schema descriptions.

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 clearly states the tool's purpose: 'Perform a visual review of a UI edit request' with specific resources (before/after screenshots) and verb (review). It explains what the tool does (evaluates if edit satisfies request) and the outcome (yes/no with explanation). However, without sibling tools, it cannot demonstrate differentiation from alternatives.

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 context: when you have UI edit screenshots and need validation. It mentions 'so you can continue to work on it' suggesting iterative improvement workflow. However, there's no explicit guidance on when to use this tool versus other validation methods or prerequisites for effective use.

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

Related 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/zueai/frontend-review-mcp'

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