Skip to main content
Glama

Get attributes

browser_get_attributes
Read-only

Retrieve an element's DOM attributes with sensitive values redacted, so you can inspect its identity, state, and configuration for automation, testing, or debugging.

Instructions

DOM attributes of an element (sensitive values redacted).

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

Input Schema

NameRequiredDescriptionDefault
nthNo
refNoElement ref from snapshot (preferred)
nameNo
roleNo
textNo
exactNo
labelNo
namesNo
pageIdNo
testIdNo
withinNoScope to a unique container (ref, role+name, label, testId or CSS selector)
sessionNo
selectorNoCSS (last resort)
placeholderNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

C2.6/5.0
Behavior3/5

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

Annotations already supply readOnlyHint, openWorldHint, and destructiveHint=false, so the safety profile is covered. The description adds one genuinely useful behavioral fact beyond them — that sensitive values are redacted — but says nothing about how elements are resolved, what happens when no element matches, or what form the attributes are returned in.

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?

One short clause with no padding, but brevity here comes from omission rather than discipline. The one substantive detail (redaction) is tucked in a parenthesis instead of being front-loaded.

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

Completeness2/5

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

With 14 optional parameters, nested 'within' scoping, zero required fields, and no output schema, this is a complex element-targeting tool that the description treats as trivial. An agent cannot tell from this definition how to disambiguate an element or what a returned attribute set looks like.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is only 21% across 14 parameters, and the description compensates for none of it. The unstated resolution model — ref preferred over role/name/text/selector, plus pageId, session, within scoping, and exact/names matching — is exactly the information an agent needs and neither schema nor description supplies.

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

Purpose3/5

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

The fragment "DOM attributes of an element" names the resource precisely enough that an agent knows it returns attribute data rather than text or HTML. But it has no verb and draws no boundary against siblings like browser_get_element and browser_get_text, so the agent must infer which 'get' returns what.

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 when-to-use guidance at all: no mention of when attributes are preferable to browser_get_element, browser_get_text, or browser_snapshot, and no stated prerequisites such as needing a snapshot first. The description offers no context to route the agent among the many sibling getters.

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