ui_builder_check_design
Check a design before you show it to anybody — one call instead of validate, view and an accessibility pass. Runs schema (document shape), catalog (the pinned catalog's validation, the mutation reducer and the Compose export gate — what ui_builder_validate runs) and a11y: controls with no label, icons and pictures with no contentDescription, touch targets under 48dp, text and icon contrast under WCAG 4.5:1 / 3:1, and text in a fixed height that clips at 200% font scale. Check a stored design (designId, optionally a past revision), a whole document, or operations applied to a scratch copy of designId exactly as ui_builder_apply would — nothing is saved. Returns summary first, then ok, the counts, and findings with the nodeId each is about, so you can fix them with ui_builder_apply and check again. rendered: true measures touch targets on a native render where the host has one (needs the ui-builder-export capability). Contrast against theme roles is resolved with the Material 3 baseline scheme, in both the light and the dark theme when a colour follows the theme (the finding names the theme that fails), and reported as a warning, never an error. hostLogic checks a design's host logic would run (it loads, exports init and onAction, and init answers what the design can hold); a design without host logic passes it for free. guidelines runs only when named: a model judges the design against the Android design guides (developer.android.com) for its platform and reports each broken rule as a warning or note with its source. It uses this host's shared model key, so it runs only for the accounts the operator enabled and is reported as skipped for everyone else; with rendered: true the visual rules are judged on the native render too.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "ui_builder_check_design"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | No | A grant token from poll_access, when you cannot set the X-Compose-Preview-Token header yourself — an MCP client fixes its headers at connect time, so this is how a token approved during this session is used in it. Prefer the header where you control it. | |
| checks | No | Which checks to run. Defaults to schema, catalog, a11y, hostLogic; `guidelines` runs only when named. | |
| designId | No | A stored design to check, or to check `operations` against. | |
| document | No | A whole DesignDocumentV1 to check instead of a stored design. | |
| rendered | No | Measure touch targets on a native render, and show it to the guidelines model. Exported Kotlin that fails to compile there is an error finding (check `native`). Defaults to false. | |
| revision | No | A past revision of `designId`. Omit for the current one. | |
| agentName | No | Optional agent/client name shown to design viewers; self-reported. | |
| agentModel | No | Optional current model name shown to design viewers; self-reported. Omit when unknown. | |
| operations | No | DesignMutationV1 objects to apply to a scratch copy of `designId` and check — a dry run. | |
| baseRevision | No | The revision `operations` were written against; a stale one is a warning. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| checks | Yes | ||
| dryRun | No | ||
| errors | Yes | ||
| schema | Yes | ||
| skipped | No | ||
| summary | Yes | ||
| designId | No | ||
| findings | Yes | ||
| revision | No | ||
| warnings | Yes | ||
| truncated | No | ||
| guidelines | No |