Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#362 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
html, javascript
领域
frontend, web-dev

调研方向

首先定位将表单转换为工具架构、并根据分组的单选输入构建参数的声明式逻辑。使用提供的 <form> 复现问题,并检查 document.modelContext.getTools(),确认缺少描述。更新单选组的处理方式,优先使用 toolparamdescription,然后回退到该组的可访问名称。通过针对单选组和现有控件类型的测试来验证行为。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Bikeshed
星标
4.7k
派生
328
平均合并
2 天 9 小时
30 天内合并 PR
15

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

webmachinelearning/webmcp 的其他 Issue

查看 webmachinelearning/webmcp 的全部 Issue

相似的 Issue

更多 Web Dev Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。