Skip to main content
Glama

get_selection

Retrieves the current canvas selection and context—selected element, mode, page, visible artboards, pending edits and errors—so agents can act on “this screen” or fix the selected element.

Instructions

What the user is looking at right now: selection (the element clicked in edit mode: 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, 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

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries full behavioral burden; it discloses what data is returned but not the safety profile (read-only implied but not stated) nor the failure mode when nothing is selected (null selection? empty object?). It does add useful scoping detail such as 'up to 4KB' and 'path as element indexes from the children of <body>'.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the key concept, which is good, but the remainder is one dense run-on sentence packing many parenthetical field definitions. Since there is no output schema this detail earns some place, yet the structure impedes scanning.

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?

For a no-param state getter with no output schema, the field enumeration supplies genuinely necessary return-value context. It omits only edge-case behavior (empty selection, partial availability), which keeps it short of fully complete.

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?

Zero parameters, so there is nothing to mis-document; baseline 4 applies. The description's field listing is effectively return-shape documentation rather than parameter guidance.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

It defines a specific resource — the current UI context (selection, mode, page, artboards, errors) — which is distinct from siblings like list_boards or list_pages that enumerate broader collections. The framing 'What the user is looking at right now' is concrete and unambiguous, though the long enumeration dilutes a crisp verb+resource statement.

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?

It gives concrete triggering examples ('fix the selected element', 'this screen'), which is strong positive guidance. It stops short of stating when NOT to use it or naming a sibling alternative (e.g., screenshot for visual context), so it's clear context without exclusions.

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