Skip to main content
Glama

bind_variable_to_paint

Attach a COLOR variable to a SOLID fill or stroke paint on a Figma node, or unbind by passing null. Applies design tokens to fills/strokes.

Instructions

Bind a COLOR variable to a SOLID fill or stroke paint (the design-token way to colour a node) — or unbind by passing variableId: null. Figma stores fill/stroke colour bindings on the paint, not the node, so this is separate from bind_variable_to_node (which covers scalar fields like width / padding / radius). target is fills (default) or strokes; index selects which paint (default 0). The paint at that index must be SOLID. Returns { ok, nodeId }.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexNoIndex of the paint within the list (default 0)
nodeIdYesNode whose fill/stroke paint to bind
targetNoWhich paint list to bind on (default fills)
variableIdYesCOLOR variable id to bind, or null to remove the binding

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.0
    • removedInput schema / properties / variableId / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / variableId / type
      Added value: +[
      +  "string",
      +  "null"
      +]
  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. First observedv0.1.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare readOnly=false and destructive=false, so the mutation safety profile is covered. The description adds useful behavior: the paint at the selected index must be SOLID, null is the unbind sentinel, and the return shape is { ok, nodeId }.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single tight paragraph, front-loaded with the core action. Every sentence carries information: purpose, distinction from sibling, parameter defaults, constraint, and return shape.

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 4-parameter mutation with full schema coverage and annotations, the description covers the essential context: what is bound, where it is stored, how to unbind, the SOLID constraint, defaults, and the return value.

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 100%, so the baseline is 3. The description adds meaning by emphasizing variableId: null as the unbind mechanism, defaulting target to fills and index to 0, and imposing the SOLID-paint constraint on the selected paint.

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 and resource: binding a COLOR variable to a SOLID fill/stroke paint, with unbind as the inverse. It explicitly distinguishes itself from bind_variable_to_node by explaining that paint-level bindings live on the paint, not the node.

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?

Clear when-to-use: design-token colouring of a fill or stroke, with the alternative bind_variable_to_node named for scalar fields. It also states the unbind path via variableId: null and the default target/index values.

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