Skip to main content
Glama

generate_ui_tree

Generates a complete UI screen or component hierarchy from a structured JSON spec, enforcing 8pt spacing, 44px touch targets, and typography standards.

Instructions

Generate a complete UI screen or component hierarchy in a single atomic pass from a structured JSON specification. Enforces enterprise UI/UX & HCI standards: strictly disallows emojis (use 'create_svg_icon' for icons), snaps spacing to 8pt grid, enforces minimum 44px interactive touch targets per Apple HIG / WCAG (Fitts's Law), and applies calibrated typography leading and tracking.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
specYesDeclarative ScreenSpec object containing name, preset ('iPhone 16', 'Desktop', etc.), fill, padding, spacing, and children array with typed elements ('frame', 'card', 'button', 'text', 'divider', 'spacer') and optional 'tag' identifiers for interaction linking. Note: Do NOT use emojis in buttons or text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses that the tool enforces standards (no emojis, 8pt grid, 44px touch targets, typography calibration) and operates atomically, which is useful. However, it doesn't state whether it creates nodes in the current document, what it returns, or error behavior.

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 dense sentence that front-loads the purpose and then lists enforcement rules. It's efficient, and while the enumeration of standards adds length, each element contributes meaningful constraint information.

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

Completeness3/5

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

There is no output schema, yet the description doesn't mention what the tool returns (e.g., node IDs, hierarchy map, success status) or whether it commits to the Figma document. Given the complexity and one nested parameter, this is a notable omission; input constraints are well-covered but downstream effects are not.

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?

The schema already describes the spec object in detail at 100% coverage. The description adds behavioral constraints on how the spec will be interpreted (spacing snapping, target sizes, typography) and reiterates the no-emoji rule, providing value beyond the schema's structural description.

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?

States a specific verb and resource: 'Generate a complete UI screen or component hierarchy in a single atomic pass from a structured JSON specification.' This clearly distinguishes it from siblings like create_frame and create_component by emphasizing whole-hierarchy generation from a spec.

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

Usage Guidelines3/5

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

The description mentions 'use create_svg_icon for icons' but does not explicitly state when to use this tool versus other creation tools like create_frame or create_component. The 'single atomic pass' phrasing implies batch use, but there is no when-not guidance or alternative routing beyond the icon case.

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