缺少声明性 WebMCP 的表单

虽然智能体通常可以推断出表单的运作方式,但提供声明性 WebMCP 元数据可使互动更可靠。

“缺少声明性 WebMCP 的表单”审核的运作方式

Lighthouse 会识别没有 toolnametooldescription<form> 元素。目前,此审核仅提供参考信息,不会导致任何警告。

解决方法

更新 HTML 表单以包含必要的 WebMCP 属性:

<form toolname="newsletter_signup" tooldescription="Subscribes the user to the weekly newsletter">
  <input name="email" type="email" toolparamdescription="The user's email address">
  <button type="submit">Sign Up</button>
</form>