Skip to main content
Glama

tree

Lists node IDs, types, and names under a chosen root in a saved .fig file to locate unknown pages and frames.

Instructions

List node ids, REST types (as in nodes and find) and names under a chosen root. A shallow outline locates pages and frames when their names are unknown; find searches known names or visible text directly.

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": {
      "file": "<file>"
    },
    "name": "tree"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesthe saved .fig: a local path (absolute recommended), or gs://bucket/object using gcloud; remote sources are unavailable with --root
jsonNonested {id,type,name,size,visible,layoutMode,children} JSON instead of indented text (about 1.7x larger); size is the local pre-rotation [width,height] (absent on the document and pages), visible appears only when false and layoutMode only on auto-layout frames; nodes on a page or in a section add firstText, their first visible stored text (breadth-first, instances not expanded, at most 200 characters), which tells a canvas label (a box around one line of text) from a screen
nodeNoa stored root id; default the whole document; use inspect for instance sublayers0:0
depthNolevels to list below the root
topFramesNolist only the screens under the root, at any depth: FRAME, COMPONENT, COMPONENT_SET and INSTANCE children of a page or of a section on one (groups, shapes and text are not screens; internal pages are skipped unless they are the root); depth does not apply; text lines start with the id, as nodes/export/bundle frame lists read them; with json, a flat array of entries without children (with firstText), adding page and, inside a section, section ids

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.11.3
    • changedInput schema / properties / json / description
      Previous value: -"nested {id,type,name,size,visible,layoutMode,children} JSON instead of indented text (about 1.7x larger); size is the local pre-rotation [width,height] (absent on the document and pages), visible appears only when false and layoutMode only on auto-layout frames"New value: +"nested {id,type,name,size,visible,layoutMode,children} JSON instead of indented text (about 1.7x larger); size is the local pre-rotation [width,height] (absent on the document and pages), visible appears only when false and layoutMode only on auto-layout frames; nodes on a page or in a section add firstText, their first visible stored text (breadth-first, instances not expanded, at most 200 characters), which tells a canvas label (a box around one line of text) from a screen"
    • addedInput schema / properties / topFrames
      Added value: +{
      +  "default": false,
      +  "description": "list only the screens under the root, at any depth: FRAME, COMPONENT, COMPONENT_SET and INSTANCE children of a page or of a section on one (groups, shapes and text are not screens; internal pages are skipped unless they are the root); depth does not apply; text lines start with the id, as nodes/export/bundle frame lists read them; with json, a flat array of entries without children (with firstText), adding page and, inside a section, section ids",
      +  "type": "boolean"
      +}
  2. Changed3 schema fields changedv0.9.3
    • changedInput schema / additionalProperties
      Previous value: -trueNew value: +false
    • changedInput schema / properties / depth / maximum
      Previous value: -18446744073709552000New value: +9007199254740991
    • changedInput schema / properties / json / description
      Previous value: -"nested {id,type,name,children} JSON instead of indented text (about 1.6x larger)"New value: +"nested {id,type,name,size,visible,layoutMode,children} JSON instead of indented text (about 1.7x larger); size is the local pre-rotation [width,height] (absent on the document and pages), visible appears only when false and layoutMode only on auto-layout frames"
  3. Changed8 schema fields changedv0.7.2
    • addedInput schema / additionalProperties
      Added value: +true
    • addedInput schema / properties / depth / maximum
      Added value: +18446744073709552000
    • addedInput schema / properties / depth / minimum
      Added value: +0
    • changedInput schema / properties / file / description
      Previous value: -"the .fig file (File > Save local copy): an absolute path, or gs://bucket/object"New value: +"the saved .fig: a local path (absolute recommended), or gs://bucket/object using gcloud; remote sources are unavailable with --root"
    • addedInput schema / properties / file / minLength
      Added value: +1
    • addedInput schema / properties / json / default
      Added value: +false
    • addedInput schema / properties / node / default
      Added value: +"0:0"
    • changedInput schema / properties / node / description
      Previous value: -"the root; default the whole document"New value: +"a stored root id; default the whole document; use inspect for instance sublayers"
  4. First observed

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the transparency burden. It discloses output shape at a high level (ids, types, names, shallow outline) and the sibling contrast, but never states that this is a read-only operation, that it has no side effects, or how large/deep output can become by default.

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?

Two tight sentences with the primary action first and the disambiguation second. Every clause earns its place; nothing is repeated from structured fields.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Five parameters with full schema coverage and no output schema; the description names what is returned (ids, types, names) and how to choose the tool. It leaves the default depth behavior and the text-vs-JSON tradeoff to the schema, which is acceptable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so all five parameters are already documented in detail. The description only loosely gestures at the root ('chosen root') and depth ('shallow outline') and adds no syntax or format guidance beyond the schema, making the baseline 3 appropriate.

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: list node ids, REST types, and names under a chosen root. It also names a sibling ('find') and contrasts the two, so an agent can distinguish them without opening a 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?

Gives an explicit selection rule: use this shallow outline when page/frame names are unknown, use find when the name or visible text is already known. It does not address other close siblings such as nodes, search, or inspect, so it stops short of full when/when-not coverage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.