Skip to main content
Glama

add_component_property

Declare a boolean, text, or instance-swap property on a Figma component or variant set. Bind it to a layer to enable show/hide, editable text, or swappable instances.

Instructions

Declare a component property on a component (or its variant set): BOOLEAN (show/hide a layer), TEXT (editable text), or INSTANCE_SWAP (swappable nested instance). The property starts inert — attach it to a layer with bind_component_property (BOOLEAN→visible, TEXT→characters, INSTANCE_SWAP→mainComponent) for it to do anything. defaultValue must match the type (boolean / string / a component key string); preferredValues (INSTANCE_SWAP only) pre-populates the swap menu. VARIANT properties come from combine_as_variants, not here. Returns { ok, componentId, propertyId, name } — pass propertyId to bind / edit / delete / set_instance_properties.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesProperty name, e.g. "Show Icon"
typeYesProperty type
componentIdYesComponent or component-set id (a variant resolves to its set)
defaultValueYesDefault: boolean (BOOLEAN), string (TEXT), or a component key (INSTANCE_SWAP)
preferredValuesNoINSTANCE_SWAP only: components/sets offered in the swap menu

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.0
    • removedInput schema / properties / defaultValue / anyOf
      Removed value: -[
      -  {
      -    "type": "boolean"
      -  },
      -  {
      -    "type": "string"
      -  }
      -]
    • addedInput schema / properties / defaultValue / type
      Added value: +[
      +  "boolean",
      +  "string"
      +]
  2. Changed1 schema field changedv0.1.3
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  3. Addedv0.1.1

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only tell the agent this is a non-read-only, non-destructive write. The description adds the key behavioral fact that the property is inert until bound, that defaultValue must be type-matched, that preferredValues only applies to INSTANCE_SWAP, and that VARIANT properties do not originate here. That is real context beyond the annotation hints.

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?

Dense and front-loaded, opening with the verb and the type set before moving to mechanics and return value. Three sentences carry a lot, but the middle sentence packs several distinct constraints (defaultValue matching, preferredValues scope) and could be split for faster scanning. No filler sentences, though.

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

Completeness5/5

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

For a mutation tool with no output schema, the description covers the two-step create-then-bind workflow, type-specific value rules, the exclusion of variant properties, and the exact return shape including which id to pass downstream. An agent has everything needed to invoke this correctly.

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

Parameters4/5

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

Schema coverage is already 100%, so the baseline is 3, and the description earns above that by adding cross-parameter constraints the schema cannot express: defaultValue's shape must match type, and preferredValues is INSTANCE_SWAP-only and pre-populates the swap menu. It also explains that componentId resolves a variant to its set. The one gap is that it does not explicitly tie the returned propertyId back to the name parameter's role.

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?

States a specific verb (Declare) and resource (a component property on a component or its variant set), and enumerates the three supported types (BOOLEAN/TEXT/INSTANCE_SWAP) with a one-line gloss of each. It also distinguishes itself from the sibling combine_as_variants, which is exactly the confusion an agent would otherwise have.

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?

Explicitly says the property 'starts inert' and must be attached via bind_component_property, and it names the target field per type (BOOLEAN→visible, TEXT→characters, INSTANCE_SWAP→mainComponent). It also excludes an alternative path: 'VARIANT properties come from combine_as_variants, not here.' When-to-use, post-conditions, and the sibling exclusion are all present.

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

Deploy Server

Other Tools