From 514b2fe50b66d65970466ae9bf2e2e37f87108bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Beaufort?= Date: Tue, 3 Mar 2026 08:50:06 +0100 Subject: [PATCH 1/2] Set default value for ToolAnotations readOnlyHint --- index.bs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/index.bs b/index.bs index 0892d93..921f5ea 100644 --- a/index.bs +++ b/index.bs @@ -328,7 +328,7 @@ dictionary ModelContextTool { }; dictionary ToolAnnotations { - boolean readOnlyHint; + boolean readOnlyHint = false; }; callback ToolExecuteCallback = Promise (object input, ModelContextClient client); @@ -365,11 +365,9 @@ callback ToolExecuteCallback = Promise (object input, ModelContextClient cl The {{ToolAnnotations}} dictionary provides optional metadata about a tool: -
-
annotations["{{ToolAnnotations/readOnlyHint}}"]
-
-

If true, indicates that the tool does not modify any state and only reads data. This hint can help [=agents=] make decisions about when it is safe to call the tool. -

+
+ : readOnlyHint + :: If true, indicates that the tool does not modify any state and only reads data. This hint can help [=agents=] make decisions about when it is safe to call the tool.

ModelContextClient Interface

From bde334180ccbedd042050c892f5c32405426ca3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Beaufort?= Date: Wed, 4 Mar 2026 06:52:53 +0100 Subject: [PATCH 2/2] Do not check existence --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 921f5ea..40eba5b 100644 --- a/index.bs +++ b/index.bs @@ -263,8 +263,8 @@ The registerTool(tool) method step class=allow-2119>should reconcile this difference.

-1. Let |read-only hint| be true if |tool|'s {{ModelContextTool/annotations}} [=map/exists=], and if - its {{ToolAnnotations/readOnlyHint}} [=map/exists=] and is true. Otherwise, let it be false. +1. Let |read-only hint| be true if |tool|'s {{ModelContextTool/annotations}} [=map/exists=] and + its {{ToolAnnotations/readOnlyHint}} is true. Otherwise, let it be false. 1. Let |tool definition| be a new [=tool definition=], with the following [=struct/items=]: