Skip to main content
Glama

pilot_snapshot

Capture accessibility tree snapshots for web elements, generating references to interact with buttons, links, and inputs through automation commands.

Instructions

Get accessibility tree snapshot with @eN refs for element selection. Use refs in click/fill/hover/etc. Use include_cursor_interactive to find non-ARIA clickable elements (@cN refs).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorNoCSS selector to scope the snapshot
interactive_onlyNoOnly show interactive elements (buttons, links, inputs)
compactNoRemove empty structural nodes
depthNoLimit tree depth (0 = root only)
include_cursor_interactiveNoScan for cursor:pointer/onclick/tabindex elements not in ARIA tree
max_elementsNoMax elements to include before truncating (saves tokens on large pages)
structure_onlyNoShow tree structure without text content — saves tokens

Implementation Reference

  • Handler function for the 'pilot_snapshot' tool.
    async ({ selector, interactive_only, compact, depth, include_cursor_interactive, max_elements, structure_only }) => {
      await bm.ensureBrowser();
      try {
        const result = await takeSnapshot(bm, {
          selector,
          interactive: interactive_only,
          compact,
          depth,
          cursorInteractive: include_cursor_interactive,
          maxElements: max_elements,
          structureOnly: structure_only,
        });
        bm.resetFailures();
        return { content: [{ type: 'text' as const, text: result }] };
      } catch (err) {
        bm.incrementFailures();
        return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
      }
    }
  • Registration of the 'pilot_snapshot' tool.
    server.tool(
      'pilot_snapshot',
      'Get accessibility tree snapshot with @eN refs for element selection. Use refs in click/fill/hover/etc. Use include_cursor_interactive to find non-ARIA clickable elements (@cN refs).',
      {
        selector: z.string().optional().describe('CSS selector to scope the snapshot'),
        interactive_only: z.boolean().optional().describe('Only show interactive elements (buttons, links, inputs)'),
        compact: z.boolean().optional().describe('Remove empty structural nodes'),
        depth: z.number().optional().describe('Limit tree depth (0 = root only)'),
        include_cursor_interactive: z.boolean().optional().describe('Scan for cursor:pointer/onclick/tabindex elements not in ARIA tree'),
        max_elements: z.number().optional().describe('Max elements to include before truncating (saves tokens on large pages)'),
        structure_only: z.boolean().optional().describe('Show tree structure without text content — saves tokens'),
      },
      async ({ selector, interactive_only, compact, depth, include_cursor_interactive, max_elements, structure_only }) => {
        await bm.ensureBrowser();
        try {
          const result = await takeSnapshot(bm, {
            selector,
            interactive: interactive_only,
            compact,
            depth,
            cursorInteractive: include_cursor_interactive,
            maxElements: max_elements,
            structureOnly: structure_only,
          });
          bm.resetFailures();
          return { content: [{ type: 'text' as const, text: result }] };
        } catch (err) {
          bm.incrementFailures();
          return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
        }
      }
    );
Behavior3/5

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

With no annotations, description carries full burden. It explains the reference notation system (@eN and @cN refs) which is crucial output behavior, but omits safety profile (read-only/destructive), performance characteristics, or side effects like whether focus changes occur.

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?

Three sentences with zero waste. Front-loaded with purpose (sentence 1), immediate usage context (sentence 2), and advanced parameter guidance (sentence 3). Every clause earns its place.

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?

Given 7 parameters with full schema coverage and no output schema, description adequately covers the essential output format (refs system) and integration pattern. Absence of explicit safety declaration and output truncation behavior are minor gaps.

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?

Schema has 100% coverage (baseline 3). Description adds value by connecting include_cursor_interactive to the @cN refs output format, explaining not just what the parameter scans for but how the results are labeled in the returned tree.

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?

Description uses specific verb 'Get' with clear resource 'accessibility tree snapshot'. The @eN refs detail and explicit mention of using refs in sibling tools (click/fill/hover/etc) effectively distinguishes this from visual screenshot tools and establishes its role as a precursor to element interaction.

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 clear guidance on consuming the output ('Use refs in click/fill/hover/etc') and specifically highlights when to use the include_cursor_interactive parameter ('to find non-ARIA clickable elements'). Lacks explicit 'when not to use' guidance or comparison to screenshot alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TacosyHorchata/Pilot'

If you have feedback or need assistance with the MCP directory API, please join our Discord server