Skip to main content
Glama

Get code for a layer

get_code
Read-onlyIdempotent

Generates CSS, HTML+CSS, React, Leptos, SwiftUI, or Jetpack Compose code for a specified layer and returns the whole layer tree for HTML, React, and Leptos.

Instructions

The code the app generates for a layer: CSS, HTML+CSS, React, Leptos, SwiftUI or Jetpack Compose (a whole layer tree for html/react/leptos).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
unitNo
nodeIdNo
languageNo
rootFontSizeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds genuinely useful behavioral detail: that html/react/leptos return a whole layer tree rather than a single node's snippet. It says nothing about default language, unit handling, or error behavior when a node has no code.

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 sentence with the resource stated first and the format list in a parenthetical. Nothing is padded, though the parenthetical scoping note about whole layer trees is slightly buried at the end.

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

Completeness2/5

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

With no output schema and 0% parameter coverage, the description carries the full burden for a tool with four inputs. It omits what nodeId identifies, how unit/rootFontSize affect the generated output, and which language is used by default — all things an agent needs before calling correctly.

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

Parameters2/5

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

Schema description coverage is 0% across four parameters. The description names the six language values, but that merely repeats the language enum and earns no credit. nodeId, unit (px vs rem), and rootFontSize are never explained, so the description does not compensate for the documentation gap.

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 states a specific resource — the generated code for a layer — and enumerates the exact output formats (CSS, HTML+CSS, React, Leptos, SwiftUI, Jetpack Compose). That is enough to distinguish it from neighbors like get_design_context or get_code_connect_map, though it never explicitly names a sibling or uses a leading verb.

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 or when-not-to-use guidance and no reference to the sibling tools (get_design_context, get_code_connect_map, inspect_document) that also surface layer information. The only implied guidance is that the caller must pick a language, which is inferred from the format list rather than stated.

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