Skip to main content
Glama

expand_node

Expands or collapses a tree node by path, waiting until it is usable and running expansion listeners so child-loading trees fill in; returns the updated UI snapshot.

Instructions

Expand (or collapse) a tree node given by its path, like clicking its toggle: ancestors are expanded on the way and expansion listeners run, so trees that load children on expand fill in. Says if the application vetoed it. Waits first (up to timeoutMs) until the component is visible, enabled, editable where needed, and not blocked by a modal dialog or busy overlay, so no wait_for is needed for a component that is about to become usable. Returns the new snapshot.

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": {
      "ref": "<ref>",
      "path": "<path>"
    },
    "name": "expand_node"
  }
}

Input Schema

NameRequiredDescriptionDefault
refYesThe tree
pathYesNode path like Root/Child (the root may be left out)
collapseNoCollapse instead of expand
timeoutMsNoHow long to wait for the component to become usable (default 10000)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden — and it does well: it discloses ancestor auto-expansion, that expansion listeners fire, that lazy-loading trees fill in children, that the app can veto the action, the waiting preconditions, the default timeout, and that a new snapshot is returned. A 3 reflects that it still omits failure/return specifics (what a veto response looks like, what happens on timeout expiry).

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?

Front-loaded with the action and its analogy, then behavior, then waiting, then return value — a sensible ordering. It is a single dense run-on chain of clauses, so slightly more punctuation or sentence breaks would improve scanability.

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?

For a 4-parameter mutation tool with no annotations and no output schema, the description covers preconditions, side effects, failure modes, and the return value, so an agent can call it correctly without follow-up calls.

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?

With 100% schema coverage the baseline is 3, and the description adds real meaning: `collapse` inverts the operation, `timeoutMs` bounds the pre-use wait, and `path` is the node identity used for ancestor traversal. `ref` ('The tree') is only implied by the phrase 'a tree node'.

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 precise verb-plus-resource ('Expand (or collapse) a tree node given by its path') and grounds it in a concrete analogy ('like clicking its toggle'). The analogy and the collapse flag distinguish it from sibling `click` without needing 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?

Explicitly tells the agent not to precede it with `wait_for` because the tool already waits for visibility, enablement, and modal/busy clearance — a real routing decision. It stops short of naming other alternatives (e.g. when to use `click` on the toggle instead) or when to skip expansion entirely.

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