Skip to main content
Glama
stitch-native

stitch-native

stitch_to_swiftui

Convert Stitch screen HTML into a SwiftUI view and flag off-token colours and warnings so you can align generated UI with your design tokens.

Instructions

Convert a Stitch screen to a SwiftUI view. Reports off-token colours and warnings.

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

Input Schema

NameRequiredDescriptionDefault
urlNoHTTPS download URL of the screen HTML (a public https URL; Stitch downloadUrls need OAuth, so pass that HTML via html instead).
htmlNoStitch screen HTML (the export, including the tailwind-config script).
modeNostate: stateless screen with a State struct + sample, Identifiable rows, a tab Picker, localized keys and callbacks (no ViewModel).layout
nameNoGenerated view/composable name.StitchScreen
pathNoPath to a Stitch HTML file. Used when html is not given.
configNostitch-native.json contents: {"targets": ["swiftui","compose","html"], "colors": {token|#hex: expr}, "colorsHtml": {token|#hex: cssValue}, "fonts": {token: expr}, "icons": {material: sfSymbol}, "iconsCompose": {material: "Icons.X.Y"}, "iconsHtml": {material: text or inline svg}, "preview": {"colorScheme": "dark|light"}}. Alias: map. Without config, config_path or map, the server looks for stitch-native.json next to `path` and in its parent directories (first one found).
config_pathNoPath to a stitch-native.json. Used when config is not given.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.1

TDQS

B3.1/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden. It discloses one useful trait — that output includes off-token colour reports and warnings — but says nothing about whether files are written, whether network access is needed for the url form, determinism, or what the response payload looks like, despite returning no structured output schema.

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?

Two sentences, front-loaded with the core purpose, with no filler. The brevity is efficient, though it leaves the second sentence carrying a lot of weight for a tool with this much configuration surface.

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

Completeness4/5

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

Considered against a seven-parameter tool with a nested config object and no annotations, the description is thin: it never explains source precedence (url vs html vs path) or what the mode toggle produces, relying fully on the schema for that. It does cover the essential conversion purpose and warning output, but an agent gets little help understanding the behavior beyond structured fields.

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

Parameters3/5

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

Schema description coverage is 100%, so all seven parameters, including the nested config object and its fallback behavior, are already documented in the schema. The description adds no parameter-level meaning beyond that, so the baseline of 3 applies.

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?

The description names a specific verb and resource ('Convert a Stitch screen to a SwiftUI view'), which cleanly separates it from stitch_to_compose and stitch_to_html by target framework. It does not explicitly contrast itself with siblings like stitch_to_ir or stitch_to_native, but the target output is unambiguous.

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

Usage Guidelines2/5

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

There is no explicit when-to-use guidance, no prerequisites, and no mention of when a different sibling (e.g. stitch_to_native or stitch_to_ir) should be chosen instead. Any routing guidance must be inferred entirely from the phrase 'SwiftUI view'.

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