Skip to content

Declarative WebMCP: a radio group's parameter never gets a description #362

Open

Description

@agm1984

Summary

A declarative tool form builds a parameter for a group of radio buttons that share a name, with each radio's
label as the title of its choice. The parameter itself never gets a description. Every other control type
we tried (text, textarea, checkbox, select, select multiple, range) takes one from toolparamdescription or
from its <label>. As a result, an agent sees the choices but not what the group is.

Reproduction

<form toolname="createProfile" tooldescription="Creates a profile.">
  <fieldset>
    <legend>Shift</legend>
    <label><input type="radio" name="shift" value="day" toolparamdescription="Which shift they work."> Day</label>
    <label><input type="radio" name="shift" value="night"> Night</label>
  </fieldset>
  <button type="submit">Create</button>
</form>
(await document.modelContext.getTools())[0].inputSchema.properties.shift

Expected: a description for shift. The obvious sources are toolparamdescription on a radio in the
group (or on all of them), the <legend> of the <fieldset> the group sits in, or the accessible name of an
enclosing role="radiogroup".

Actual:

{
  "type": "string",
  "anyOf": [
    { "type": "string", "const": "day", "title": "Day" },
    { "type": "string", "const": "night", "title": "Night" }
  ],
  "enum": ["day", "night"]
}

None of these added a description:

  • toolparamdescription on the first radio, the second radio, or both
  • aria-description on a radio
  • aria-description on the <fieldset>
  • the <fieldset>'s <legend>

It is not a stale schema. Changing toolparamdescription on a text input in the same form is reflected by the
next getTools() call, and removing and restoring toolname (re-registering the tool) did not add one either.

Suggestion: use the first toolparamdescription found among the group's radios. Failing that, fall back
to the group's accessible name: the <legend> of the nearest <fieldset>, or the label of a
role="radiogroup" ancestor. That would mirror the <label> fallback other controls already get.

Activity

  1. ozlemts commented on Nov 10, 2026

    @ozlemts

    Hi! I'd like to take a look at this issue and contribute a fix.
    I plan to investigate the declarative radio group parameter description handling and add a regression test if appropriate.
    Is anyone currently working on this?

  2. domfarolino commented on Nov 10, 2026

    @domfarolino
    Collaborator

    Thanks for filing this issue. Yeah, for radio groups we need a clear way to populate the parameter-level description, just like we do for the other declarative controls. The exact declarative algorithms aren't in the spec yet; that work is still being developed in declarative-api-explainer.md, where the input-schema synthesis rules are currently intentionally incomplete / left out for now.

    @ozlemts if you want to work on this, the explainer is probably the best place to start. A small PR could flesh out the expected radio-group mapping in the "Input schema synthesis" section — in particular, where the group's parameter description comes from and how it relates to the per-option labels/titles.

    We don't need to solve the whole declarative processing model. Keeping the PR focused on the radio-group schema shape would be a good first contribution, and we can help refine the exact behavior in review.

  3. agm1984 commented on Nov 10, 2026

    @agm1984
    Author

    Thanks for filing this issue.

    I was working on webmcp in my design system with claude and it was the one that recommended we submit this issue. I thought that was a good idea. I appreciate knowing that it could be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions