accessibility-quality-check
Rapidly assess the richness of an app's accessibility tree and get a recommendation to use accessibility data or fall back to screenshots, saving tokens and time.
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 qualityQuality 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
Quick query: Calls
idb ui describe-all(~80ms)Assess richness: Counts tappable elements, text fields
Return score: Quality assessment + recommendation
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
Related Tools
idb-ui-describe: Full accessibility tree with element detailsidb-ui-find-element: Search for specific element by namescreenshot: 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
| Name | Required | Description | Default |
|---|---|---|---|
| udid | No | ||
| screenContext | No |