Skip to main content
Glama

map

Read-only

Capture actionable page elements as a snapshot with @eN references, enabling agents to target and interact with browser UI reliably.

Instructions

Snapshot actionable elements and assign @eN refs (uses Playwright aria_snapshot mode='ai').

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": "map"
  }
}

Input Schema

NameRequiredDescriptionDefault
depthNoLimit snapshot depth.
leaseNoOptional lease token to present if the target session is leased (0.7.0). Threaded per-call; never read from the server's env.
indentNoPreserve YAML indent.
sessionNoOptional session name to target (omit for the shared 'default'). On a daemon shared with other agents, pass a UNIQUE name for stateful multi-step work (go→click→fill) so you don't collide on 'default'.
max_charsNoCap the returned snapshot.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.21.0
    • addedInput schema / properties / max_chars
      Added value: +{
      +  "default": 40000,
      +  "description": "Cap the returned snapshot.",
      +  "type": "integer"
      +}
  2. First observedv0.1.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds that refs are @eN-style and come from Playwright's aria_snapshot in 'ai' mode, which is useful context about ref format and provenance. It does not disclose the critical lifecycle trait — that refs go stale after navigation or DOM change — nor the truncation behavior implied by max_chars.

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?

A single front-loaded sentence with the action and its output named first, then the implementation parenthetical. No filler. The parenthetical about Playwright is slightly incidental but does clarify snapshot format, so it earns its place.

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

Completeness3/5

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

With no output schema, the description should carry more of the return-value burden; it names the @eN refs but says nothing about the YAML structure, truncation behavior, or what an agent should do with the refs next (pass to click/fill). For a five-parameter tool sitting in a dense family of map/observe/diff tools, this is adequate but leaves real gaps.

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 description coverage is 100%, so all five parameters (depth, lease, indent, session, max_chars) are already documented in the schema with defaults and rationale. The description adds nothing about parameters, which is acceptable at full coverage but earns only the baseline.

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?

The description states a specific verb-and-resource pair: it snapshots actionable elements and assigns them @eN refs. An agent can tell what it produces (a ref-annotated element snapshot). However, it does not distinguish itself from close siblings like map_compact, diff_map, observe, or candidates, so the boundary is left to inference.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to call this versus map_compact, observe, candidates, or find, nor any stated prerequisites (page loaded, session targeted). The only hint is in the schema's 'session' parameter, not the description. Usage must be inferred entirely from the name and the sibling list.

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