From 45afd88934805962a1067cf943918932f757b9df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Beaufort?= Date: Thu, 20 Aug 2026 11:39:13 +0200 Subject: [PATCH 1/3] Change `executeTool()` inputObject type from `object` to `any` --- index.bs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index 69bed7e..e40eb40 100644 --- a/index.bs +++ b/index.bs @@ -604,7 +604,7 @@ The {{ModelContext}} interface provides methods for web applications to register interface ModelContext : EventTarget { Promise registerTool(ModelContextTool tool, optional ModelContextRegisterToolOptions options = {}); Promise> getTools(optional ModelContextGetToolOptions options = {}); - Promise executeTool(RegisteredTool tool, optional object inputObject = {}, optional ModelContextExecuteToolOptions options = {}); + Promise executeTool(RegisteredTool tool, optional any inputObject, optional ModelContextExecuteToolOptions options = {}); attribute EventHandler ontoolchange; }; @@ -919,8 +919,16 @@ The executeTool(tool, inputObject{}". + +1. If |inputObject| is not {{undefined}}, then: + + 1. If |inputObject| [=Object type|is not an Object=], then return [=a promise rejected with=] a + {{TypeError}}. + + 1. Set |inputArguments| to the result of [=serializing a JavaScript value to a JSON string=] + given |inputObject|. If this threw an exception, then return [=a promise rejected with=] that + exception. 1. Let |promise| be [=a new promise=] created in [=this=]'s [=relevant realm=]. From abc7c99779da9254d15b5640a7d7b7d65740e4ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Beaufort?= Date: Mon, 7 Sep 2026 11:22:06 +0200 Subject: [PATCH 2/3] Use TC39 object check --- index.bs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.bs b/index.bs index e40eb40..27aa735 100644 --- a/index.bs +++ b/index.bs @@ -108,6 +108,7 @@ spec: ECMASCRIPT; urlPrefix: https://tc39.es/ecma262/ type: dfn text: surrounding agent; url: surrounding-agent text: agent cluster; url: sec-agent-clusters + text: is not an object; url: sec-object-type

Introduction

@@ -923,7 +924,7 @@ The executeTool(tool, inputObject Date: Thu, 10 Sep 2026 18:19:16 +0200 Subject: [PATCH 3/3] refactor: simplify input object serialization by removing unnecessary undefined check --- index.bs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/index.bs b/index.bs index 564397e..462bf60 100644 --- a/index.bs +++ b/index.bs @@ -928,16 +928,10 @@ The executeTool(tool, inputObject{}". +1. If |inputObject| [=is not an Object=], then return [=a promise rejected with=] a {{TypeError}}. -1. If |inputObject| is not {{undefined}}, then: - - 1. If |inputObject| [=is not an Object=], then return [=a promise rejected with=] a - {{TypeError}}. - - 1. Set |inputArguments| to the result of [=serializing a JavaScript value to a JSON string=] - given |inputObject|. If this threw an exception, then return [=a promise rejected with=] that - exception. +1. Let |inputArguments| be the result of [=serializing a JavaScript value to a JSON string=] given + |inputObject|. If this threw an exception, then return [=a promise rejected with=] that exception. 1. Let |promise| be [=a new promise=] created in [=this=]'s [=relevant realm=].