Skip to main content
Glama
stitch-native

stitch-native

stitch_to_native

Convert a Stitch screen's HTML and Tailwind into SwiftUI, Jetpack Compose, or standalone HTML with matching theme files, so you can move designs into native app code.

Instructions

Convert one Stitch screen to the project's targets in one call (swiftui, compose, html; default = the config's targets, else swiftui + compose), plus the theme file of each. In state mode html is skipped with a warning.

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_native"
  }
}

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).
targetsNoEcosystems to emit, out of swiftui, compose, html. Overrides the config's `targets`; without either: swiftui + compose. A comma-separated string is also accepted.
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.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. It does disclose real behavior: default target resolution (config `targets`, else swiftui + compose) and that html is skipped with a warning in state mode. It says nothing about what is written where (files on disk vs returned content), whether existing output is overwritten, or how partial failures across targets are reported — material gaps for a code-generation 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?

Two dense sentences, front-loaded with the primary action and the target set; the parenthetical enumerations and the state-mode caveat earn their space. Slightly compressed to the point of being terse, but no filler.

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?

For an 8-parameter, nested-config generator with no output schema and no annotations, the description covers inputs well but leaves the result side blank — an agent cannot tell whether it gets file contents, paths, or a status, nor where the 'theme file of each' lands. That is a meaningful completeness gap given the tool's complexity.

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 coverage is 100%, so all 8 parameters are already documented, and the description largely restates the target-default rule and the state-mode html skip. It adds no insight on input precedence (url vs html vs path) or how `config`/`config_path` interact with the auto-discovery fallback beyond what the schema text already says. Baseline 3 applies when the schema does the heavy lifting.

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?

States a specific verb (Convert) and resource (one Stitch screen) plus the emitted artifacts (swiftui, compose, html, plus a theme file each). The phrase 'in one call' plus the multi-target list implicitly differentiates it from the single-target siblings stitch_to_swiftui/stitch_to_compose/stitch_to_html, though no sibling is named explicitly.

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 'one call' phrasing and the target list imply this is the batched/multi-target path, but the description never states when to pick it over the per-target siblings, nor any prerequisites about input sources. Usage is inferable rather than stated.

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