Skip to main content
Glama

get_selection

What the user is looking at right now: selection (the element the user clicked on a board: file, path as element indexes from the children of , tag, kind and label, text, source outerHTML up to 4KB, hash, computed styles), mode…

Instructions

What the user is looking at right now: selection (the element the user clicked on a board: file, path as element indexes from the children of , tag, kind and label, text, source outerHTML up to 4KB, hash, computed styles), mode (canvas, edit = an element is selected, focus, play), page and pageName, visibleArtboards (boards visible on screen), selectedArtboards, dirty (pending saves), edits (recent edit history), erroredArtboards and firstError (boards with errors). Use it for requests like 'fix the selected element' or 'this screen'.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_selection"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

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?

With no annotations, the description must carry the safety/behavior burden; it does imply a read-only snapshot of current UI state and adds useful constraints (outerHTML truncated to 4KB, 'dirty' means pending saves, 'edits' is recent history). However it never states explicitly that the call is non-mutating, nor anything about cost, freshness, or behavior when nothing is selected.

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 core concept and structured as a single parenthetical inventory followed by a usage sentence. The dense run-on enumeration of fields is long but each item carries information an agent would otherwise lack; minor punctuation load slows parsing.

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?

There is no output schema, so the description must define the return shape, and it does so comprehensively, covering every top-level field and the nested structure of 'selection' (file, path, tag, kind, label, text, outerHTML, hash, computed styles). For a zero-parameter tool this is as complete as an agent needs.

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?

The tool takes zero parameters, so the baseline is 4; there is nothing for the description to disambiguate. The schema is empty at 100% coverage, and the description correctly requires no argument specification.

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?

Opens with a specific verb-plus-resource framing: 'What the user is looking at right now', then enumerates the concrete categories of state returned (selection, mode, page, visibleArtboards, dirty, edits, errors). This is clearly distinguishable from siblings like read_board or screenshot because it is explicitly about live user focus/selection state.

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?

Provides concrete triggering phrases ('fix the selected element', 'this screen'), which gives an agent a clear signal for when to call it. It stops short of naming when to prefer an alternative such as read_board or screenshot instead, so no explicit exclusions.

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