Skip to content

Commit 3da78ad

Browse files
Set default value for ToolAnnotations readOnlyHint (#123)
1 parent c6c24d4 commit 3da78ad

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

index.bs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ The <dfn method for=ModelContext>registerTool(<var>tool</var>)</dfn> method step
258258
</ol>
259259
</div>
260260

261-
1. Let |read-only hint| be true if |tool|'s {{ModelContextTool/annotations}} [=map/exists=], and if
262-
its {{ToolAnnotations/readOnlyHint}} [=map/exists=] and is true. Otherwise, let it be false.
261+
1. Let |read-only hint| be true if |tool|'s {{ModelContextTool/annotations}} [=map/exists=] and
262+
its {{ToolAnnotations/readOnlyHint}} is true. Otherwise, let it be false.
263263

264264
1. Let |tool definition| be a new [=tool definition=], with the following [=struct/items=]:
265265

@@ -323,7 +323,7 @@ dictionary ModelContextTool {
323323
};
324324

325325
dictionary ToolAnnotations {
326-
boolean readOnlyHint;
326+
boolean readOnlyHint = false;
327327
};
328328

329329
callback ToolExecuteCallback = Promise<any> (object input, ModelContextClient client);
@@ -360,11 +360,9 @@ callback ToolExecuteCallback = Promise<any> (object input, ModelContextClient cl
360360

361361
The {{ToolAnnotations}} dictionary provides optional metadata about a tool:
362362

363-
<dl class="domintro">
364-
<dt><code><var ignore>annotations</var>["{{ToolAnnotations/readOnlyHint}}"]</code></dt>
365-
<dd>
366-
<p>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.
367-
</dd>
363+
<dl class="domintro" dfn-type=dict-member dfn-for=ToolAnnotations>
364+
: <dfn>readOnlyHint</dfn>
365+
:: 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.
368366
</dl>
369367

370368
<h4 id="model-context-client">ModelContextClient Interface</h4>

0 commit comments

Comments
 (0)