Skip to main content
Glama

Set strokes

figma_set_strokes
Idempotent

Set the outline (stroke) of nodes: exactly one of a solid color, a gradient (as in figma_set_fills), or remove: true to take it off; plus weight, alignment, dashes, line ends (cap) and corners (join).

Instructions

Set the outline (stroke) of nodes: exactly one of a solid color, a gradient (as in figma_set_fills), or remove: true to take it off; plus weight, alignment, dashes, line ends (cap) and corners (join). sides sets per-side weights on frames, rectangles, components and instances: a side left out is 0 — so { sides: { bottom: 1 } } is a bottom border — unless weight is given, which then fills it. This is the border — for the inside colour use figma_set_fills. Returns per-item results: { updated, items: [{ id, ok, error? }] } — one node failing does not fail the call. Editors: Design; unverified: FigJam, Slides.

Input Schema

NameRequiredDescriptionDefault
capNoEnd decoration of open paths and lines, as in figma_create_line.
joinNoHow corners of the path are joined.
alignNo
colorNoStroke colour, #rgb / #rrggbb / #rrggbbaa.
forceNoOverwrite on purpose. A write to a node someone changed after you last read it is refused (STALE); read it again and resend instead. Pass true only when the person said to overwrite their edit.
sidesNoPer-side weights in px — a bottom border, a table-row divider, an input underline.
removeNoRemove every stroke instead; give nothing else with it.
weightNoStroke weight in px.
nodeIdsYesNodes to change.
sessionNoOptional sessionId or file name, to pick a Figma file when more than one is connected.
gradientNoA gradient stroke instead of `color`.
dashPatternNoDash and gap lengths in px, e.g. [4, 2].
idempotencyKeyNoCaller-owned retry key, ≤128 chars. Re-calling with the same key never executes twice: it returns the existing result, or waits for the op still in flight. Supply your own for anything large — if the MCP client times out (rather than the bridge), only a key you chose can be used to retry safely.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.0
    • addedInput schema / properties / force
      Added value: +{
      +  "description": "Overwrite on purpose. A write to a node someone changed after you last read it is refused (STALE); read it again and resend instead. Pass true only when the person said to overwrite their edit.",
      +  "type": "boolean"
      +}
  2. First observedv0.1.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare non-readonly, idempotent, non-destructive, so the safety profile is covered. The description adds value beyond that: the partial-failure contract ('one node failing does not fail the call') and the editor coverage caveat. The STALE/force retry mechanism is documented in the schema rather than here, so this is strong but not exhaustive.

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 but front-loaded: the exclusivity rule and the fills contrast arrive first, then sides semantics, then the return shape. Every clause carries information, though the single paragraph packing all of it is heavy reading for a 13-parameter tool; a short list would scan faster.

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?

With 13 parameters, nested gradient objects and no output schema, the description still supplies the return contract (`{ updated, items: [{ id, ok, error? }] }`), the partial-failure semantics, the fills alternative and the editor support matrix. Nothing an agent needs to call this correctly is missing.

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 92%, so the baseline is 3; the description earns above that by explaining the non-obvious `sides` semantics that the schema's terse 'Per-side weights in px' does not: an omitted side becomes 0 (so `{ sides: { bottom: 1 } }` is a bottom border) unless `weight` is supplied to fill it. That is a genuine correctness-affecting rule not derivable from the schema.

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 ('Set the outline (stroke) of nodes') and immediately differentiates from the nearest sibling: 'This is the border — for the inside colour use figma_set_fills.' An agent can distinguish stroking from filling without opening either schema.

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?

Names the mutual-exclusion rule ('exactly one of a solid color, a gradient, or remove: true') and routes the inside-colour case to figma_set_fills. It also notes the editor scope (Design verified; FigJam and Slides unverified), which helps an agent decide whether to attempt it. It doesn't state when to prefer a gradient stroke over a solid one, so it falls just short of 5.

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