v1.38.1 — Shared-Library Variable Tools Fixed
Fixed
Shared-library variable tools returned wrong answers — silently — since v1.29.0.
figma_get_library_variables reported totalCollections: 0 for every file, on every plan, regardless of how many team libraries were subscribed. figma_import_library_variable reported failed imports as successes with id: undefined.
Neither tool has ever returned a correct result in any released version — the defect is in the original v1.29.0 commit.
Root cause. connector.executeCodeViaUI() resolves to the Desktop Bridge envelope { success, result }, never the injected script's bare return value. Both tools read the envelope directly, so Array.isArray(envelope) was always false, the __error sentinel landed at .result.__error leaving its guard as dead code, and .id was always undefined.
Why it went unreported for two months. The failure presented as a success — an empty result with a plausible hint attached ("subscribe a library via Figma > Assets panel") — so it read as a legitimate negative answer rather than a fault.
Fix. Both tools unwrap through a shared helper that also maps a bridge-level success: false onto the error path, so a plugin timeout surfaces as a real error instead of being swallowed as "0 collections". An import yielding no id is now an explicit error.
Audited all 26 executeCodeViaUI call sites; only these two were affected.
Reported by Isabella Minzly, with an accurate root-cause diagnosis.
npm note: this version was superseded by v1.38.2 before publishing. Install
figma-console-mcp@1.38.2or later — it contains this fix.