Skip to main content
Glama
allegiant

MQScript MCP Server

by allegiant

mqscript_cmpcolor

Compare screen color at specified coordinates with expected color value using similarity tolerance for automated mobile testing and UI validation.

Instructions

Compare color at specified point with expected color

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expectedColorYesExpected color in BBGGRR format
resultVariableNoVariable name to store comparison resultresult
similarityNoColor similarity tolerance (0-1)
xYesX coordinate to check
yYesY coordinate to check

Implementation Reference

  • The handler function for the 'mqscript_cmpcolor' tool. It generates MQScript code to compare the color at specified coordinates with an expected color value using similarity tolerance, and outputs a trace message based on the result.
    handler: async (args: { x: number; y: number; expectedColor: string; similarity?: number; resultVariable?: string }) => { const { x, y, expectedColor, similarity = 0.9, resultVariable = 'result' } = args; const script = `Dim ${resultVariable}\n${resultVariable} = CmpColor(${x}, ${y}, "${expectedColor}", ${similarity})\nIf ${resultVariable} Then\n TracePrint "Color matches at (${x}, ${y})"\nElse\n TracePrint "Color does not match at (${x}, ${y})"\nEnd If`; return { content: [ { type: 'text', text: `Generated MQScript compare color command:\n\`\`\`\n${script}\n\`\`\`\n\nThis compares color at (${x}, ${y}) with expected color "${expectedColor}" using ${similarity} similarity.` } ] }; }
  • The input schema defining parameters for the 'mqscript_cmpcolor' tool: x, y coordinates, expectedColor, optional similarity and resultVariable.
    inputSchema: { type: 'object' as const, properties: { x: { type: 'number', description: 'X coordinate to check' }, y: { type: 'number', description: 'Y coordinate to check' }, expectedColor: { type: 'string', description: 'Expected color in BBGGRR format' }, similarity: { type: 'number', description: 'Color similarity tolerance (0-1)', default: 0.9 }, resultVariable: { type: 'string', description: 'Variable name to store comparison result', default: 'result' } }, required: ['x', 'y', 'expectedColor']
  • The full tool definition object for 'mqscript_cmpcolor' within ColorCommands, including name, description, inputSchema, and handler. This is where the tool is structured for registration.
    cmpColor: { name: 'mqscript_cmpcolor', description: 'Compare color at specified point with expected color', inputSchema: { type: 'object' as const, properties: { x: { type: 'number', description: 'X coordinate to check' }, y: { type: 'number', description: 'Y coordinate to check' }, expectedColor: { type: 'string', description: 'Expected color in BBGGRR format' }, similarity: { type: 'number', description: 'Color similarity tolerance (0-1)', default: 0.9 }, resultVariable: { type: 'string', description: 'Variable name to store comparison result', default: 'result' } }, required: ['x', 'y', 'expectedColor'] }, handler: async (args: { x: number; y: number; expectedColor: string; similarity?: number; resultVariable?: string }) => { const { x, y, expectedColor, similarity = 0.9, resultVariable = 'result' } = args; const script = `Dim ${resultVariable}\n${resultVariable} = CmpColor(${x}, ${y}, "${expectedColor}", ${similarity})\nIf ${resultVariable} Then\n TracePrint "Color matches at (${x}, ${y})"\nElse\n TracePrint "Color does not match at (${x}, ${y})"\nEnd If`; return { content: [ { type: 'text', text: `Generated MQScript compare color command:\n\`\`\`\n${script}\n\`\`\`\n\nThis compares color at (${x}, ${y}) with expected color "${expectedColor}" using ${similarity} similarity.` } ] }; } }

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/allegiant/MQScript_MCP'

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