Skip to main content
Glama
nbiish

Better Browser MCP

by nbiish

browser_get_attribute

Retrieve a specific HTML attribute value from a page element using its snapshot reference. Get href, value, aria-label, or custom data attributes without fetching a full snapshot.

Instructions

Read a single HTML attribute from an element referenced by snapshot ref. Use attr: 'href' to get a link's URL (e.g. extract a Stripe payment link from a share button), attr: 'value' for current input values, attr: 'aria-label' for accessibility text, or any custom data-* attribute. Returns the attribute value as a string, or an empty string if the attribute is not set. Cheaper and more precise than a full snapshot when you need one specific value.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refYesExact target element reference from the page snapshot
attrYesThe HTML attribute name to read (e.g. 'href', 'value', 'aria-label', 'data-testid')
tabIdNoOptional tab ID to target. When omitted, routes to the agent's active tab. Use browser_list_tabs to see available tab IDs.
elementYesHuman-readable element description used to obtain permission to interact with the element
Behavior4/5

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

With no annotations, the description carries the full burden. It clearly communicates the read-only nature ('Read'), the return behavior (string, empty string if not set), and performance characteristics (cheaper than snapshot). It doesn't explicitly state it has no side effects, but 'Read' strongly implies that.

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 tight sentences: purpose, examples, and return/performance note. Every sentence adds useful information, with no filler or redundancy.

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?

For a simple read-only tool, the description adequately covers its purpose, usage, and output. It doesn't address error cases like invalid references, but that's acceptable given the tool's simplicity and the schema's clarity. The absence of an output schema is compensated by the return type explanation.

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 coverage is 100% with all parameters already described. The description adds value by giving practical examples for the 'attr' parameter and explaining the return behavior for unset attributes, enriching understanding beyond the schema.

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 reads a single HTML attribute from a snapshot-referenced element. It differentiates itself from siblings by noting it's 'cheaper and more precise than a full snapshot', making its unique value distinct.

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

Usage Guidelines5/5

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

Provides explicit usage context with concrete examples (href for links, value for inputs, aria-label for accessibility) and implies the alternative scenario: use this instead of a full snapshot when only one value is needed. This gives clear guidance on when to choose the tool.

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/nbiish/betterbrowsermcp'

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