Skip to main content
Glama
stitch-native

stitch-native

stitch_to_html

Convert a Stitch screen into a single self-contained HTML page with inline CSS tokens, semantic tags, no scripts, and mapped Material icons for layout-only output.

Instructions

Convert a Stitch screen to one self-contained HTML page (a single block with tokens as CSS custom properties, semantic tags, no script, no external URLs). Layout mode only. Material icons become filled from the config's iconsHtml; unmapped icons are listed.

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

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.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 real behavioral traits: generated output is self-contained with no script or external URLs, Material icons are rewritten to spans fed by config iconsHtml, and unmapped icons get reported. It does not say what the tool actually returns (HTML text, written file, or a report), whether it errors on missing/unparseable input, or how the icon list surfaces in the result. The unaddressed "layout mode only" versus the `state` enum option further muddies the behavioral picture.

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 tight paragraph with the core action front-loaded and constraints after it; every clause (no script, no external URLs, icon mapping) carries information. It is dense but not padded, though the placement of "Layout mode only" as a trailing fragment after the output spec reads as an afterthought rather than a structured caveat.

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 a seven-parameter, nested-config, annotation-free tool with no output schema, the description covers the output shape well but stops short of describing the return value entirely — an agent cannot tell whether to expect HTML text, a written path, or a combined report with unmapped icons. Input-source precedence and failure behavior are also left to the schema and inference. Adequate, but there are real gaps for a tool of this 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 the schema already documents every parameter, including the mode enum and the config shape. The description adds a little genuine meaning by tying the `config.iconsHtml` mapping to observable icon-span output and by implying the config lookup fallback matters. That increment is thin relative to the seven parameters and nested config object, so baseline 3 is right.

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 concrete verb and resource ("Convert a Stitch screen to one self-contained HTML page") and pins down the output contract: single <style> block, tokens as CSS custom properties, semantic tags, no script, no external URLs. That is well beyond a restatement of the name. The only blur is "Layout mode only," which reads oddly against the `mode` parameter that also accepts `state`, leaving the agent to infer the claim applies to HTML output rather than to the tool as a whole.

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?

Usage is implied by the task (producing HTML rather than SwiftUI/Compose) but never stated explicitly, and no sibling is named — nothing tells the agent when to pick stitch_to_compose or stitch_to_swiftui instead. It also gives no guidance on which input path to prefer; the url/html/path precedence lives only in the schema descriptions. The "unmapped icons are listed" note hints at a useful precondition (verify config iconsHtml coverage) without framing it as guidance.

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