You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Include aria-label as part of the Declarative API's toolparamdescription sources #286
According to these docs: When toolparamdescription isn't set the browser uses the content within the associated <label> and skips descendants that are labelable. If there isn't a label, the browser refers to the aria-description.
Some existing sites use aria-label in place of <label> for some fields and actions. It would be helpful if aria-label was included in the determination of the toolparamdescription value, for instance, in order of priority:
The aria-label-only case is worth covering, but I think defining a new <label> → aria-label → aria-description priority would make the generated schema disagree with the control's accessibility semantics.
The Accessible Name and Description Computation already handles these sources and gives aria-labelledby precedence, then aria-label, then the host-language label. In particular, an explicit aria-label can intentionally override a visible <label>, while the proposed order would do the opposite and would omit aria-labelledby entirely. The same specification has a separate accessible-description computation, where aria-describedby precedes aria-description.
A more interoperable direction may therefore be to define the fallback in terms of the control's computed accessible name (and, if needed, its computed accessible description), rather than reading individual ARIA attributes in a WebMCP-specific order. That would also give #66's multiple-label case and aria-labelledby a defined result.
There is still a schema-mapping decision to make: #67 asks whether the short label/accessibility name belongs in JSON Schema title rather than description, while the longer accessible description maps more naturally to description. Since the declarative synthesis algorithm remains a TODO in #210, I don't think a code PR is safe until that mapping is resolved.
Activity
mlmrx commentedon Sep 3, 2026
The
aria-label-only case is worth covering, but I think defining a new<label>→aria-label→aria-descriptionpriority would make the generated schema disagree with the control's accessibility semantics.The Accessible Name and Description Computation already handles these sources and gives
aria-labelledbyprecedence, thenaria-label, then the host-language label. In particular, an explicitaria-labelcan intentionally override a visible<label>, while the proposed order would do the opposite and would omitaria-labelledbyentirely. The same specification has a separate accessible-description computation, wherearia-describedbyprecedesaria-description.A more interoperable direction may therefore be to define the fallback in terms of the control's computed accessible name (and, if needed, its computed accessible description), rather than reading individual ARIA attributes in a WebMCP-specific order. That would also give #66's multiple-label case and
aria-labelledbya defined result.There is still a schema-mapping decision to make: #67 asks whether the short label/accessibility name belongs in JSON Schema
titlerather thandescription, while the longer accessible description maps more naturally todescription. Since the declarative synthesis algorithm remains a TODO in #210, I don't think a code PR is safe until that mapping is resolved.sawyer-stripe commentedon Sep 3, 2026
Yes, this is a better way of describing the behavior I'd be expecting (sorry, mixed up the suggested order in my original ticket).