Skip to main content
Glama

set_variable_code_syntax

Set or remove a variable's code token name per platform (WEB, iOS, Android) to ensure codegen uses the exact token name instead of deriving one. Useful for mapping design variables to existing code tokens.

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
Behavior5/5

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

The description discloses that null removes, omitted is untouched, and returns { ok, variableId, name, codeSyntax }. It adds context about being the authoritative name for codegen, which goes beyond annotations (readOnlyHint=false, destructiveHint=false). No contradiction with annotations.

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 a single dense paragraph that front-loads the purpose, covers behavior, use case, and return value. It is efficient without fluff, though slightly long. Could be split for readability.

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?

The description covers the behavior, return value, and a use case. It does not mention error conditions or the exact structure of codeSyntax (handled by schema), and no output schema exists. For a 2-param tool, it is sufficiently complete.

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 baseline is 3. The description adds an example (e.g., WEB: '--color-primary') and context about authoritative name, but the schema already has detailed descriptions and examples per platform. The added value is marginal.

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 'Declare a variable's code-side token name per platform (codeSyntax)' and distinguishes it as the 'write half' of codeSyntax, contrasting with read tools get_design_context/get_variable_defs. It is specific and distinct from sibling tools.

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 specific use case: 'When authoring design-system variables from existing code tokens, declare the source token name here'. It also explains behavior per platform (set, remove, untouched) but lacks explicit guidance on when not to use it or alternatives like set_variable_value.

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