Skip to content

WebMCP tools with undescribed parameters, or too many

webmcp-tools-unclearinfo
On this page

Why it matters

  • An agent builds each parameter's value from its name and description. A parameter called q or d with no description may be filled with what you did not mean.
  • A page offering dozens of tools crowds an agent's choice, so it picks the wrong one or none. Lighthouse 13.6 warns above 40 tools.
  • This is information: Lighthouse gives these warnings half the score, not zero.

Example

Wrong
<script>
  navigator.modelContext?.registerTool({ name: 'search_products', description: 'ابحث في منتجات المتجر', inputSchema: { type: 'object', properties: { q: { type: 'string' } } }, execute: () => [] })
</script>
Right
<script>
  navigator.modelContext?.registerTool({ name: 'search_products', description: 'ابحث في منتجات المتجر', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'ما يبحث عنه الزائر' } } }, execute: () => [] })
</script>

How to fix

Describe each parameter with description (or title), and in forms with toolparamdescription, and merge similar tools into one with a parameter that chooses between them:

html
<form toolname="book_table" tooldescription="Book a table at the restaurant">
  <input name="date" type="date" toolparamdescription="The day of the booking" required>
  <input name="people" type="number" toolparamdescription="How many people">
</form>

How we detect

With the same recorder the invalid WebMCP tools rule reads, in each engine: for each tool we count its parameters and those with no title or description (or, in forms, no name or toolparamdescription), and we count the page's tools.