From 5c78bd7aa10fe89b1e09ed4cfad84028ae84ebc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Beaufort?= Date: Wed, 12 Aug 2026 15:56:16 +0200 Subject: [PATCH 1/2] refactor: change RegisteredTool inputSchema type to object --- index.bs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/index.bs b/index.bs index 4274a31..32a299e 100644 --- a/index.bs +++ b/index.bs @@ -562,8 +562,9 @@ The getTools(options) method steps :: |tool definition|'s [=tool definition/description=] : {{RegisteredTool/inputSchema}} - :: |tool definition|'s [=tool definition/input schema=] if it is not the empty string; - otherwise undefined. + :: the result of [=parse a JSON string to a JavaScript value=] given |tool + definition|'s [=tool definition/input schema=], if |tool definition|'s [=tool + definition/input schema=] is not the empty string; otherwise undefined. : {{RegisteredTool/window}} :: |targetDocument|'s [=relevant global object=] @@ -713,7 +714,7 @@ dictionary RegisteredTool { // done, and there's no need to do it again on tool exposure. DOMString title; required DOMString description; - DOMString inputSchema; + object inputSchema; required Window window; required USVString origin; ToolAnnotations annotations; @@ -734,9 +735,9 @@ dictionary RegisteredTool { tool registration, via {{ModelContextTool/description}}. : tool["{{RegisteredTool/inputSchema}}"] - :: A stringified JSON Schema object describing the expected input parameters for the tool - [[!JSON-SCHEMA]]. It is the string derived from {{ModelContextTool/inputSchema}} during - registration. + :: A JSON Schema object describing the expected input parameters for the tool + [[!JSON-SCHEMA]]. It is the same value provided at tool registration, via + {{ModelContextTool/inputSchema}}. : tool["{{RegisteredTool/window}}"] :: The {{Window}} of the document that registered the tool. From c1bbb5b76e2c1dcaf1b120c839159c84ca5c238c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Beaufort?= Date: Thu, 13 Aug 2026 08:27:59 +0200 Subject: [PATCH 2/2] Address feedback --- index.bs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.bs b/index.bs index 32a299e..70b527f 100644 --- a/index.bs +++ b/index.bs @@ -566,6 +566,9 @@ The getTools(options) method steps definition|'s [=tool definition/input schema=], if |tool definition|'s [=tool definition/input schema=] is not the empty string; otherwise undefined. + Note: This will never throw an exception, because the string stored in the tool + definition is always a valid JSON string. + : {{RegisteredTool/window}} :: |targetDocument|'s [=relevant global object=] @@ -736,7 +739,7 @@ dictionary RegisteredTool { : tool["{{RegisteredTool/inputSchema}}"] :: A JSON Schema object describing the expected input parameters for the tool - [[!JSON-SCHEMA]]. It is the same value provided at tool registration, via + [[!JSON-SCHEMA]]. It is a deep copy of the schema provided at tool registration, via {{ModelContextTool/inputSchema}}. : tool["{{RegisteredTool/window}}"]