Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto Apto para principiantes
#362 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
html, javascript
Área
frontend, web-dev

Línea de trabajo

Comienza localizando la lógica declarativa que convierte formularios en esquemas de herramientas y que construye los parámetros a partir de entradas de radio agrupadas. ReproSíltelo con el <form> proporcionado e inspecciona document.modelContext.getTools() para confirmar que falta la descripción. Actualiza el manejo de los grupos de radio para usar primero toolparamdescription y, si no existe, recurrir al nombre accesible del grupo. Verifica el comportamiento con pruebas para grupos de radio y tipos de controles existentes.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Bikeshed
Estrellas
4.7k
Forks
328
Merge medio
2 d 9 h
PR fusionados (30 d)
15

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de webmachinelearning/webmcp

Todos los issues de webmachinelearning/webmcp

Issues similares

Más issues de Web Dev

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.