Fanta docs
Tool Reference

Read, query & debug

Inspect the open project and page tree without mutating them.

get_editor_state reports the project root, pages, focused page or opened component, selection, viewport, editability, hints, and capability flags for newer design operations. Its components overview contains at most 100 definitions; check component_count and more_components, then use get_design_system to discover the rest. Pass empty_space: [width,height] to find a free top-left for a new top-level frame on the focused canvas.

get_design_system reports collections, modes, typed variables, component properties, and variant sets. offset and limit page the variables, components, and component sets independently with the same window (default 100, maximum 200). Advance offset until each relevant more_variables, more_components, or more_component_sets flag is false; their counts can differ. collection filters variables only. include_bindings: true reads bindings on selected nodes. list_comments reads unresolved review threads by default.

batch_get without ids lists the focused page or opened component by default. It uses depth 2, 200 direct children, and detail: "summary". The result reports child_count, children_offset, children_limit, and more_children; continue with offset and limit until done. A page listing is refused if it would traverse more than 1,000 nodes, even when its response is small; reduce depth or limit, page top-level layers with offset, or request relevant exact IDs. With exact ids, the default detail: "style" reports editable world bounds, fills, strokes, effects, layout, constraints, text, and bindings in the design-operation vocabulary. Use detail: "style" on a page listing to merge these properties into each listed node; detail: "raw" returns internal node records only with exact IDs. Pass include_geometry: true for world bounds on a summary. A response over 256 KiB is also refused rather than truncated; narrow depth, child count, IDs, geometry, or detail.

Read style before replacing a node's entire paint or effect stack. A reported image fill references an existing asset, while set_fill requires encoded image bytes in source; internal or read-only paint kinds are not all writable through that operation.

read_fnx_source without path lists source files. With a project-relative path, it returns source text with truncated, next_offset, and a notice. offset is a 1-based line number; limit counts lines. The default text budget is 64 KiB per call, with max_bytes capped at 1 MiB. Follow next_offset before making whole-file edits. Imported .fig pages may be much wider than one result.

validate_fnx_source accepts a project-relative path and optional complete source candidate. With source, it checks the candidate without writing it; without source, it checks the saved file. It also checks managed project JSON: the manifest, document metadata and motion, variables and modes, component definitions and sets, page headers, asset index, and FNX identity sidecars. For an existing JSON file, validation checks whether the complete project can load with the candidate. Repair diagnostics before saving with file tools; valid JSON syntax alone is insufficient.