Skip to main content
Glama

get_attributes

Retrieve HTML attribute values such as href, src, class, or data-* from a matching element. Specify a selector and optional attribute to get one value or all attributes as a dictionary.

Instructions

Read HTML attributes from a matching element.

Use this tool when you need the value of one or more HTML attributes such as href, src, value, class, id, name, type, aria-label, or data-*.

Args: selector: CSS selector or SeleniumBase text-matching selector for the target element. attribute: Specific HTML attribute to retrieve. When omitted, return all HTML attributes of the element as a dictionary.

Returns: The requested attribute value, or a dictionary containing all HTML attributes of the element when attribute is omitted.

Tool selection: - Need one or more HTML attribute values from a specific element -> use this tool. - Need to discover multiple matching elements or inspect their text -> use 'find_elements'. - Need visible text or HTML content -> use 'get_content'. - Need to check presence or visibility -> use 'check_for_condition'.

This is a read-only operation and does not modify the element.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYes
attributeNo
Install Server

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations, the description properly discloses that the operation is read-only and does not modify the element, and it describes the two return shapes. It does not mention behavior when the selector matches no element or multiple elements, but the main behavioral traits an agent needs before calling are covered.

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?

The description is organized into short labeled sections (Args, Returns, Tool selection) with no redundant sentences. Each section earns its place, and the key purpose and read-only nature are front-loaded.

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?

Given that there is no output schema, the description documents the return values, selector semantics, and read-only behavior. Minor gaps such as no-match/multiple-match behavior are not specified, but the tool is a simple read operation and the description is otherwise complete.

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

Parameters5/5

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

Schema description coverage is 0%, but the description compensates fully: it explains the selector format (CSS or SeleniumBase text-matching), the meaning of attribute, and the exact behavior when attribute is omitted. It even gives attribute examples, adding far more value than the bare 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 opens with a specific verb-resource pair ('Read HTML attributes') and immediately ties it to a concrete use case. The 'Tool selection' bullets further distinguish it from find_elements, get_content, and check_for_condition, so the agent can disambiguate without opening schemas.

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?

It explicitly states when to use this tool ('Need one or more HTML attribute values from a specific element') and explicitly routes other intents to named sibling tools. This is the strongest form of usage guidance.

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

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/seleniumbase/SeleniumBase'

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