Skip to main content
Glama

browser_dom

Query an element's complete DOM state by CSS selector: visibility, text, attributes, computed style, and position. Use to confirm element existence and visibility before interactions.

Instructions

Query detailed DOM state of a single element matched by CSS selector: visibility, text, attributes, computed style, and bounding box position.

中文详情:

  • 用途:查询指定 CSS 选择器元素的完整 DOM 状态,包括可见性、文本、属性、计算样式和位置坐标

  • 何时使用:点击/输入前确认元素存在且可见时;调试元素被遮挡问题时;验证元素属性(disabled/readonly/checked)时;获取元素位置坐标用于截图时

  • 输出:{ ok: boolean, selector: string, exists: boolean, visible: boolean, text: string, attributes: object, computedStyle: object, boundingBox: { x, y, width, height } }

  • 参数:

    • selector (string, 必填):要查询的 CSS 选择器

  • 错误:选择器无匹配返回 exists=false 但不抛出;选择器语法错误抛出 'Invalid selector'

  • 示例:{"selector":"#submit-btn"}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS 选择器
Behavior5/5

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

With no annotations, the description fully explains behavior: returns specific fields (exists, visible, text, etc.), error cases (no match returns exists=false, invalid selector throws error), and output structure. This is comprehensive for a read-only query.

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?

The description is somewhat lengthy but well-organized with clear sections (English, then Chinese with subheadings). Every sentence adds value, and the structure aids readability. Not overly verbose for the information provided.

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?

Given no output schema, the description covers output structure, parameter details, error behavior, and provides an example. All necessary context for an agent to use the tool correctly is present.

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% (CSS 选择器). The description adds context about the selector's purpose (query a single element) but no new technical or format details beyond the schema. Baseline 3 is appropriate.

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?

The description clearly states the tool queries detailed DOM state of a single element by CSS selector, specifying visibility, text, attributes, computed style, and bounding box. It uses specific verbs and resources, and the details help distinguish it from siblings like browser_click or browser_element_status.

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?

The description provides explicit when-to-use scenarios: before click/input to confirm element existence/visibility, debugging occlusion, verifying attributes, getting coordinates. It does not explicitly mention when not to use or alternative tools, but the guidance is clear and relevant.

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/validpilot/ai-verify-mcp'

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