Skip to main content
Glama
stitch-native

stitch-native

extract_tokens

Extracts Stitch design tokens such as colors and spacing into SwiftUI, Jetpack Compose, or CSS :root themes, enabling agents to map screen styles into native code.

Instructions

Extract Stitch design tokens (colours, spacing) as a SwiftUI theme, a Compose theme or CSS custom properties (:root).

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

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).
pathNoPath to a Stitch HTML file. Used when html is not given.
platformNoswiftui

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 burden and does not meet it. It never explains that the inputs are mutually exclusive alternatives (all four parameters are optional), that url triggers a network download, whether files are written, or what the returned output looks like. Only the output formats are conveyed, which is the one behavioural fact present.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence, zero filler, with the resource and the three output targets front-loaded. Given how little it says, however, the brevity is efficient rather than thorough.

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 tool with four optional parameters, no annotations and no output schema, the description should state the one-of url/html/path rule and at least the shape of the returned theme. As written it is adequate to understand what is produced but not sufficient to call the tool correctly on the first attempt.

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 75%, so the schema already documents url, html and path with useful notes about OAuth-gated Stitch downloadUrls. The description does add real value by decoding the otherwise opaque enum value "html" into "CSS custom properties (:root)", but adds nothing about the input-source precedence the parameters imply.

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 and resource ("Extract Stitch design tokens") and enumerates the artifacts produced (colours, spacing) plus all three output targets. It implicitly separates itself from the stitch_to_* siblings by being token-level rather than screen conversion, but never says so outright, so differentiation is left to inference.

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 when-to-use guidance at all: nothing tells the agent to prefer this over stitch_to_swiftui or stitch_to_compose, and nothing says how to choose between the url, html and path inputs. The platform enumeration hints at intent but gives no selection criteria or exclusions.

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