Skip to main content
Glama
playwright-ui-mcp

playwright-ui-mcp

by ailabs-393

browser_get_visible_elements

Retrieves all visible interactive elements on a page, including buttons, links, and inputs, with selectors for reliable UI interaction and inspection.

Instructions

Get all visible interactive elements on the page (buttons, links, inputs, etc.) with their selectors for interaction

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": {
      "pageId": "<pageId>"
    },
    "name": "browser_get_visible_elements"
  }
}

Input Schema

NameRequiredDescriptionDefault
pageIdYesThe page ID to analyze

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

B3.4/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 disclosure burden. It implies a read-only, non-mutating discovery call and tells the agent the return content includes selectors, but says nothing about whether it scrolls, handles iframes/shadow DOM, waits for load, or how large the result can be. That is meaningful behavior left unstated.

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?

One compact sentence with no filler, front-loaded with the verb and resource, with the parenthetical examples earning their place by scoping what counts as interactive. The trailing 'for interaction' clause is slightly redundant but still communicates intent.

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?

The tool is simple (one param, no output schema, no annotations), and the description covers purpose and roughly what comes back (elements plus selectors). However, with no output schema the agent gets no sense of the result shape or ordering, and no note about state requirements before calling, leaving gaps for a browser-automation step.

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 coverage is 100% and the single pageId parameter is already documented in the schema, so the description adds nothing about parameter meaning or format beyond 'on the page'. Baseline 3 applies when the schema does the work.

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?

States a specific verb and resource ('Get all visible interactive elements on the page') and enumerates examples (buttons, links, inputs) so an agent can tell it apart from browser_get_content, which returns page content rather than interactive targets. It also previews the useful payload (selectors for interaction). It stops short of naming an explicit alternative.

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

Usage Guidelines3/5

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

Usage is only implied: 'with their selectors for interaction' hints this is the discovery step before browser_click or browser_type. There is no explicit when-to-use statement, no prerequisite (e.g., page must be launched/navigated first), and no mention of when to prefer browser_screenshot or browser_get_content instead.

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