Skip to main content
Glama

set_variable_code_syntax

Declare the per-platform code syntax for a design variable. Set the exact token name (e.g., WEB: '--color-primary') so codegen uses your source token instead of deriving a name.

Instructions

Declare a variable's code-side token name per platform (codeSyntax) — the write half of the codeSyntax that get_design_context / get_variable_defs surface to codegen as the authoritative name (e.g. WEB: "--color-primary"). Per platform (WEB / ANDROID / iOS): a non-empty string sets the declaration, null removes it, an omitted platform is untouched. When authoring design-system variables from existing code tokens, declare the source token name here so future codegen resolves to the exact token instead of deriving a name. Returns { ok, variableId, name, codeSyntax } with the declarations now in effect.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeSyntaxYesPer-platform declarations: string sets, null removes, omitted is untouched
variableIdYesVariable id
Behavior4/5

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

Annotations already indicate this is not read-only and not destructive, but the description adds crucial behavioral details: per-platform semantics ('a non-empty string sets the declaration, null removes it, an omitted platform is untouched'), the return shape ('Returns { ok, variableId, name, codeSyntax }'), and the distinction between setting and removing. This goes beyond the bare annotation flags, though it doesn't discuss permissions or failure modes.

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?

The description is four sentences and packs a lot of information: the core purpose, per-platform behavior, a use-case scenario, and the return value. It is front-loaded with the action and resource, and every sentence contributes meaning. It is slightly long but not padded; the only minor redundancy is the example echoing the schema example.

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?

Even though there is no output schema, the description explicitly list the return fields and the effect on state. It covers the write operation's semantics, the three platform behaviors, and a motivating scenario. It doesn't address error conditions or prerequisites, but for a focused mutation tool with good annotations, this is sufficient. It earns a 4 rather than a 5 because it could briefly mention idempotency or what happens when an invalid variableId is provided.

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?

The schema already has 100% parameter coverage with descriptions for both 'variableId' and the nested 'codeSyntax' object, including the string/null/omitted semantics. The description essentially paraphrases the schema's own text ('Per-platform declarations: string sets, null removes, omitted is untouched'). The example adds a little color, but the description provides no new semantic information beyond what the schema already conveys, so it lands at the baseline for high schema coverage.

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 opens with a specific verb and resource: 'Declare a variable's code-side token name per platform (codeSyntax)'. It clearly distinguishes itself as the 'write half' of codeSyntax, explicitly referencing the read counterparts (get_design_context / get_variable_defs), and provides a concrete example (WEB: "--color-primary"). This leaves no ambiguity about what the tool does and differentiates it from sibling mutation tools like set_variable_value or rename_variable.

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

Usage Guidelines4/5

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

The description provides a clear use case: 'When authoring design-system variables from existing code tokens, declare the source token name here so future codegen resolves to the exact token instead of deriving a name.' It also establishes context by naming the read counterparts, implying when you need to query codeSyntax you would use those instead. However, it doesn't explicitly list alternatives or state when not to use the tool, so it falls just short of a 5.

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/awdr74100/figwright'

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