Skip to main content
Glama

ai_layout

Compile layout specs into App Inventor screens: dry-run and fidelity-check a plan, build the UI, or apply theme tokens for consistent styling.

Instructions

Layout IR compiler: plan (dry run + fidelity report), apply (build the screen), theme (tokens).

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": "ai_layout"
  }
}

Input Schema

NameRequiredDescriptionDefault
specNoScreen spec { name, title?, props?, root } (plan/apply)
actionNoWhat to do
screenNoScreen name (theme)
tokensNotheme: colour/type tokens
checkAssetsNoplan: check assets (default true)
createScreenNoapply: create the screen (default true)
allowMissingAssetsNoapply: continue when an asset is absent

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.1

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose the key behavioral distinction that plan is non-mutating (dry run + fidelity report) while apply writes a screen. It does not say whether apply overwrites an existing screen, what happens on partial failure, or what the fidelity report contains, which are significant gaps for a mutation-capable tool.

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?

A single front-loaded sentence with zero filler, and the mode-to-behavior mapping is the first thing read. It is arguably too compressed for a seven-parameter, three-mode tool – 'IR' and the terse parentheticals assume familiarity.

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?

Seven parameters, a nested spec object, three distinct modes, no annotations and no output schema – the structured fields do not fill the gap, and the one-line description leaves key questions unanswered: what the fidelity report returns, whether apply is idempotent or overwrites, and how allowMissingAssets interacts with checkAssets. Inadequate for this complexity.

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 100%, so the baseline is 3, but the description goes beyond by tying the action enum values to their own parameter subsets (plan uses the dry run path, theme uses screen and tokens), which helps an agent know which params matter per mode. It does not explain the shape of the nested spec object beyond 'name, title?, props?, root' already in the schema.

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

Purpose4/5

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

Names the resource ('Layout IR compiler') and gives a specific action-to-outcome mapping for all three modes: plan is a dry run with a fidelity report, apply builds the screen, theme handles tokens. An agent can tell what it gets from each mode without opening the schema, though nothing distinguishes it from siblings like ai_screen or ai_build.

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 parenthetical descriptors imply the natural workflow (plan as dry run before apply) and that theme is a separate token-only path, which is useful implied guidance. But there is no explicit statement of when to choose this over ai_screen/ai_build, nor any stated prerequisite such as needing an existing project or screen.

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