Skip to main content
Glama

get_attribute

Read an element's attribute or live property, such as value, href, disabled, checked, or aria-expanded. Waits for the element to exist and returns the value or null.

Instructions

Read an attribute or property of an element, e.g. an input's value, a link's href, or whether it is disabled, checked, or aria-expanded. Waits for the element to exist (it does not need to be visible). Returns the value, or null if it is not set; the live property wins when one exists, so 'value' gives the text currently in an input. Use get_text for visible text, and assert_attribute to check a value as a test step.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesAttribute or property name, e.g. 'value', 'href', 'disabled', 'checked', 'class', or 'aria-expanded'.
selectorYesHow to find the element, e.g. { by: 'css', value: '#login-button' } or { by: 'id', value: 'user-name' }. Prefer id, name, or a short CSS selector.
timeoutMsNoHow long to wait for the element to exist, in milliseconds (default 10000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.3.0
    • addedInput schema / properties / name / description
      Added value: +"Attribute or property name, e.g. 'value', 'href', 'disabled', 'checked', 'class', or 'aria-expanded'."
    • addedInput schema / properties / selector / description
      Added value: +"How to find the element, e.g. { by: 'css', value: '#login-button' } or { by: 'id', value: 'user-name' }. Prefer id, name, or a short CSS selector."
    • addedInput schema / properties / selector / properties / by / description
      Added value: +"Locator strategy: css, xpath, id, name, class/className, tag/tagName, linkText, or partialLinkText."
    • addedInput schema / properties / selector / properties / value / description
      Added value: +"The locator for that strategy, e.g. '#login-button' for css, 'user-name' for id, or //button[@type=\"submit\"] for xpath."
    • addedInput schema / properties / timeoutMs / description
      Added value: +"How long to wait for the element to exist, in milliseconds (default 10000)."
  2. First observedv0.1.2

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 carries the full burden and does well: it discloses the existence-wait (independent of visibility), the null return when unset, and the property-beats-attribute precedence rule. It does not mention default/hard timeout behavior or failure modes when the element never appears, which the schema only partially covers.

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 dense sentences, front-loaded with the core action and examples, then the wait/return semantics, then the sibling routing. Every clause earns its place.

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?

No output schema exists, so the description must explain returns, and it does ('the value, or null if it is not set'), alongside wait semantics and alternatives. Nothing an agent needs to call this correctly is missing.

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%, so the baseline is 3, but the description adds genuine meaning beyond it by explaining the live-property-wins rule ('value' gives the text currently in an input), which clarifies how the 'name' parameter resolves at runtime.

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?

States a specific verb ('Read') and resource ('attribute or property of an element') and illustrates with concrete cases (value, href, disabled, checked, aria-expanded). It also explicitly names the sibling it is not (get_text) so an agent can route without opening either schema.

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?

Gives explicit alternatives with selection conditions: get_text for visible text, assert_attribute for value assertions as a test step. It also states the wait/visibility precondition ('Waits for the element to exist (it does not need to be visible)'), leaving nothing to inference.

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