bind_variable_batch
Batch-bind multiple fields to variables across all matching nodes under a root node in one call. Filter by type, name, or variant and preview eligible nodes with a dry run.
Instructions
Bind several fields to variables on ALL nodes selected under rootId, in one call. select (at least one criterion, all must match): type (FRAME, TEXT, COMPONENT, INSTANCE...), nameEquals, nameMatches (regular expression), variantProperties ({"Size":"Compact"}, on COMPONENT or INSTANCE). bindings: [{field, variableId}] with the fields of bind_variable_field plus fills and strokes (binds the color of every SOLID paint; COLOR variable); variableId null unbinds. Instance children are skipped unless includeInstanceChildren. where (optional) keeps a binding only where a field meets a condition: {field?, rawValue?, unbound?, boundTo?}. field is the field read (default: the binding's own field, so {unbound:true, rawValue:12} on a paddingTop binding binds only raw paddingTop values equal to 12); rawValue is a number, string or boolean (a #rrggbb text for fills and strokes); unbound:true needs no variable on that field; boundTo: needs that variable already bound. For fills and strokes the condition is per paint. matched counts the nodes selected, eligible those where at least one binding passes where. dryRun:true lists the eligible nodes (matchedIds, max 500) and fieldsWouldBind, and writes nothing: use it first. Returns matched, nodesBound, nodesFailed, fieldsBound and failures [{nodeId, name, field, error}] (200 at most, failuresTotal gives the real count). Time budget: if reached, the answer is PARTIAL with nextCursor; counts are per call, add them up.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"rootId": "<rootId>",
"select": "<select>",
"bindings": "<bindings>"
},
"name": "bind_variable_batch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| where | No | ||
| cursor | No | nextCursor of a previous PARTIAL answer, to continue where it stopped | |
| dryRun | No | ||
| rootId | Yes | Node under which the nodes are selected (the root itself is a candidate) | |
| select | Yes | ||
| bindings | Yes | ||
| maxNodes | No | Matched nodes per call (default 5000) | |
| timeBudgetMs | No | Time budget of the plugin for this call in ms (default 60000, max 100000). When it is reached the answer says it is PARTIAL and gives nextCursor. | |
| includeInstanceChildren | No |