Skip to main content
Glama

get_attributes

Fetch HTML attribute values from an element using a CSS selector. Returns the requested attribute, such as href or class, or a dictionary of all attributes when none is specified.

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 element presence/visibility -> use 'check_condition'.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYes
attributeNo

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Addedv1.2.0

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure and explicitly states 'This is a read-only operation and does not modify the element.' It also describes the return behavior for both cases: the requested attribute value or a dictionary of all attributes. It does not specify behavior for multiple matching elements or missing selectors, but the key side-effect and return expectations 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 well-structured with Args, Returns, and Tool selection sections, and the main purpose is front-loaded in the first sentence. Every section earns its place; the bulleted alternatives are clear and there is no filler.

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?

The description is complete enough for a simple read-only getter: it explains parameter semantics, return values, and when to use alternatives, which matters because there is no output schema. It could additionally clarify whether the first matching element is used when a selector matches multiple elements, but this is a minor gap for the stated use case.

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%, so the description fully compensates by explaining selector as 'CSS selector or SeleniumBase text-matching selector' and attribute as an optional parameter whose omission returns all HTML attributes. This adds substantial meaning beyond the bare schema types and defaults.

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 and resource: 'Read HTML attributes from a matching element.' It clearly identifies the domain (HTML attributes) and the target (a matching element), and the Tool selection section explicitly distinguishes it from sibling tools like find_elements, get_content, and check_condition.

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?

The description gives an explicit 'Use this tool when you need the value of one or more HTML attributes' statement and then provides a bulleted Tool selection list naming exact alternatives for other needs. An agent can determine when to invoke this tool versus find_elements, get_content, or check_condition without guessing.

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

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-mcp'

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