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.`
            }
          ]
        };
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'compare' but doesn't specify what happens during comparison (e.g., returns a boolean, sets a variable, or logs result). It lacks details on permissions, side effects, error handling, or output format, which is inadequate for a tool with potential screen interaction.

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, efficient sentence that front-loads the core action ('Compare color'). It avoids unnecessary words, but could be more structured by explicitly mentioning key parameters or context. Overall, it's appropriately sized with zero waste.

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

Completeness2/5

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

Given the tool's complexity (color comparison at coordinates), lack of annotations, and no output schema, the description is incomplete. It doesn't explain the comparison result (e.g., boolean outcome stored in 'resultVariable'), error cases, or interaction with the screen, leaving significant gaps for agent understanding.

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?

The description adds minimal meaning beyond the input schema, which has 100% coverage with clear parameter descriptions (e.g., 'expectedColor' in BBGGRR format). The description implies parameters for point ('specified point') and color comparison, but doesn't elaborate on semantics like coordinate systems or color formats. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose3/5

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

The description states the tool's purpose as 'Compare color at specified point with expected color', which is clear but vague. It specifies the verb ('compare') and resource ('color'), but lacks details on what 'point' refers to (screen coordinates) or the comparison mechanism. It doesn't distinguish from siblings like 'mqscript_findcolor' or 'mqscript_getpixelcolor', which are related color tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention siblings like 'mqscript_findcolor' (which searches for colors) or 'mqscript_getpixelcolor' (which retrieves color at a point), leaving the agent without context for tool selection. No explicit when/when-not instructions or prerequisites are included.

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

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