Skip to main content
Glama

jsx

Create design trees by nesting JSX markup in a single atomic call, building complete subtrees with built children. Use parent, replaceId, and insertIndex to place the subtree in the document.

Instructions

Create design trees with nested JSX markup. One jsx call builds a complete subtree atomically — nesting is the hierarchy. Keep a single logical unit inside one call; the returned root's children are already built, not stubs to be filled in later.

Examples: jsx({markup: ""}) jsx({markup: "Account"})

Elements: frame, text, rect, ellipse, line, icon, image, instance, component, group, section, vector Attributes (frame): layout, justify, items, wrap, w, h, minW, maxW, p, gap, bg, fill, rounded, stroke, shadow, blur, bgblur, opacity, layoutPositioning Attributes (text): size, weight, lineHeight, font, fill, w (w="fill" for wrap), maxLines, textTruncation Effects: shadow="0,8,32,0,#0006" or shadow={shadow(0,8,32,0,'#0006')}; blur={10} for layer blur; bgblur={20} for frosted-glass/glassmorphism background blur. Multiple effects merge automatically. Decoration in auto-layout: floating orbs/blobs/decorative shapes inside a row/column parent need layoutPositioning="absolute" so they don't get stacked into the main-axis flow. Full-frame backgrounds: set the parent frame's bg directly. Don't add a separate backdrop. Supported gradient strings (CSS-like subset, not full CSS):

  • linear-gradient(deg, <#hex> %, ...) e.g. "linear-gradient(135deg, #A 0%, #B 100%)"

  • linear-gradient(to , ) directions: top/right/bottom/left and corners (e.g. "to bottom right")

  • radial-gradient() centered, ellipse-fill — no position/shape modifiers

  • radial-gradient(circle, ) centered, circle shape only

  • conic-gradient(from deg, ) Unsupported (will be rejected): "circle at X% Y%", "ellipse at ...", "X% Y%" position syntax, named colors (red/blue/...), hsl(), and numeric stops without a percent sign. Text: content here Instance: Self-closing: (use line for dividers/separators; rect/ellipse for SMALL pure decoration with no children — page-level backgrounds belong on the parent frame's bg) Arc/Ring: (arc="start end innerRadius?" — innerRadius 0-1 makes a donut/ring) Grid layout: call help({ name: "grid-layout" }) for tracks, gaps, and when row/column is a better fit Variable binding: fill/bg/stroke accept qualified bare-name token strings (e.g. bg="$Theme/Bg/Surface"). Object literals (fill={{variable_id:...}}) drop the binding silently — always use the string form.

Swap an existing subtree: jsx({replaceId: "", markup: "..."}) replaces the old node at the same parent and sibling index atomically, preserving position in one call. Markup must have a single root. Use jsx for tree creation; edit for property updates on known nodes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
markupYesJSX-like nested markup string
parentNoTarget parent node ID — the frame/container the new subtree will live inside
replaceIdNoReplace this existing node in-place (keeps parent + sibling index). Old node is deleted on success. Markup must be single-root. Mutually exclusive with parent.
insertIndexNoPosition among parent siblings (0 = first). Omit to append at end. Ignored when replaceId is set (inherits old node index).
Behavior4/5

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

No annotations provided, so description carries full burden. Discloses atomic build behavior, replacement semantics (delete old node), supported/unsupported gradient patterns, effect merging, and self-closing rules. Missing details on error handling or auth requirements.

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?

Well-structured with front-loaded purpose, then examples, then detailed sections. Slightly verbose in listing all supported elements and attributes, but justified given the tool's complexity.

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?

Covers purpose, parameters, syntax, behavioral nuances, and references sibling tools. Missing return value description and error handling, but overall comprehensive for a complex tool with no output schema.

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

Parameters5/5

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

Schema coverage is 100%, but description adds significant value: explains mutual exclusivity of parent and replaceId, inherit behavior of insertIndex with replaceId, and provides extensive markup syntax examples, attribute lists, and special cases for gradients, effects, and variable binding.

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

Purpose5/5

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

The description clearly states the tool creates design trees with nested JSX markup, building complete subtrees atomically. It distinguishes from sibling tools like edit and help by specifying that jsx is for tree creation, not property updates or grid layout queries.

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

Usage Guidelines5/5

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

Explicit guidance on when to use this tool (tree creation, replacement) versus alternatives (edit for property updates, help for grid layout, help for grid-layout). Includes examples and specific use cases like swap with replaceId.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/musepy/genable'

If you have feedback or need assistance with the MCP directory API, please join our Discord server