Skip to main content
Glama
conorluddy

XC-MCP: XCode CLI wrapper

by conorluddy

Accessibility Quality Check

accessibility-quality-check
Read-onlyIdempotent

Assess accessibility tree richness to decide between accessibility queries and screenshots. Returns quality score and recommendation to prevent wasted tokens on unnecessary screenshots.

Instructions

accessibility-quality-check

Quick assessment of accessibility tree richness - decide whether to use accessibility or screenshots.

Overview

Rapidly queries the accessibility tree and assesses data richness without returning full element details. Returns a quality score and recommendation (accessibility-ready or screenshot-fallback) in ~80ms with minimal token cost. Prevents agents from wasting tokens on expensive screenshots when accessibility data is sufficient.

Parameters

Optional

  • udid (string): Target identifier - auto-detects if omitted

  • screenContext (string): Screen name for semantic tracking (e.g., "LoginScreen")

Returns

  • quality: "rich" | "moderate" | "minimal"

  • recommendation: "accessibility-ready" | "consider-screenshot"

  • elementCounts: Total elements, tappable elements, text fields, element types

  • queryTime: Query execution time in milliseconds

  • queryGuidance: Next steps based on quality assessment

Examples

Quick check of current screen

const check = await accessibilityQualityCheckTool({
  screenContext: 'LoginScreen'
});

if (check.quality === 'rich') {
  // Use accessibility: idb-ui-describe
} else {
  // Fall back to screenshot
}

Check before deciding automation approach

const assessment = await accessibilityQualityCheckTool({
  udid: 'DEVICE-UDID'
});

// Workflow guided by quality

Quality Levels

Rich (✅ Use accessibility)

  • 3 tappable elements, OR

  • Text input fields detected

  • Recommendation: Use idb-ui-describe and accessibility-based navigation

Moderate (⚠️ Try accessibility first)

  • 2-3 tappable elements

  • Some custom UI that may not be recognized

  • Recommendation: Try accessibility tree first, fall back to screenshot if needed

Minimal (📸 Use screenshot)

  • ≤1 element, OR

  • No tappable elements found

  • Recommendation: Take screenshot for visual analysis

How It Works

  1. Quick query: Calls idb ui describe-all (~80ms)

  2. Assess richness: Counts tappable elements, text fields

  3. Return score: Quality assessment + recommendation

  4. No elements returned: Just the counts and guidance

Cost Comparison

  • accessibility-quality-check: ~80ms, 30 tokens

  • Full idb-ui-describe: ~120ms, 50 tokens

  • screenshot: ~2000ms, 170 tokens

  • idb-ui-describe: Full accessibility tree with element details

  • idb-ui-find-element: Search for specific element by name

  • screenshot: Visual fallback when accessibility insufficient

Notes

  • Returns quality assessment only (not full element tree)

  • Recommended as first step before choosing automation approach

  • Saves tokens by preventing unnecessary screenshots

  • Identifies when UI has minimal accessibility support

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidNo
screenContextNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
qualityYesrich | moderate | minimal
successYes
textFieldsYes
totalElementsYes
recommendationYesaccessibility-ready | consider-screenshot
tappableElementsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.1.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "quality": {
      +      "description": "rich | moderate | minimal",
      +      "type": "string"
      +    },
      +    "recommendation": {
      +      "description": "accessibility-ready | consider-screenshot",
      +      "type": "string"
      +    },
      +    "success": {
      +      "type": "boolean"
      +    },
      +    "tappableElements": {
      +      "type": "number"
      +    },
      +    "textFields": {
      +      "type": "number"
      +    },
      +    "totalElements": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "success",
      +    "quality",
      +    "recommendation",
      +    "totalElements",
      +    "tappableElements",
      +    "textFields"
      +  ],
      +  "type": "object"
      +}
  2. Addedv1.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly and idempotent, but the description goes further by disclosing the underlying mechanism ('Calls idb ui describe-all'), expected latency (~80ms), token cost comparison, and that it 'Returns quality assessment only (not full element tree).' This gives agents an accurate model of behavior and side effects beyond what annotations provide.

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 long but well-organized with clear headings, code examples, and a decision table. Some redundancy exists between Overview, How It Works, Cost Comparison, and Notes, but the structure helps an agent quickly extract the decision logic without losing important detail.

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

Completeness5/5

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

For a decision-support tool with two optional parameters and no required inputs, the description is complete: it explains parameters, return values, quality thresholds, recommendations, cost trade-offs, and relationships to sibling tools. An agent has everything needed to call it correctly and interpret the result.

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

Parameters4/5

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

Schema coverage is 0%, so the description must compensate. It does: udid is explained as 'Target identifier - auto-detects if omitted,' and screenContext as 'Screen name for semantic tracking' with an example value. The meaning is clear, though it could have specified expected formats or constraints more precisely.

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 states a specific verb and resource: 'Quick assessment of accessibility tree richness - decide whether to use accessibility or screenshots.' It clearly differentiates this tool from similar siblings like idb-ui-describe and screenshot by framing it as the decision gate before those tools.

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

Usage Guidelines5/5

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

The description explicitly says when to use the tool ('Recommended as first step before choosing automation approach') and provides a concrete decision rule: use accessibility when quality is rich, fall back to screenshot when minimal. It also names related tools and how they relate, giving clear routing guidance.

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