@@ -258,7 +258,7 @@ To <dfn for="model context">unregister a tool</dfn> given a {{ModelContext}} |mo
2582581. Let |tool map| be |modelContext|'s [=ModelContext/internal context=]' s [=model context/tool
259259 map=] .
260260
261- 1. [=Assert=] |tool map|[|tool name|] [=map/exists=] .
261+ 1. If |tool map|[|tool name|] does not [=map/exist=] , then return .
262262
2632631. Let |exposed origins| be |tool map|[|tool name|] 's [=tool definition/exposed origins=] .
264264
@@ -395,16 +395,20 @@ The <dfn method for=ModelContext>registerTool(<var>tool</var>, <var>options</var
3953951. Let |untrusted content hint| be true if |tool|'s {{ModelContextTool/annotations}} [=map/exists=] and
396396 its {{ToolAnnotations/untrustedContentHint}} is true. Otherwise, let it be false.
397397
398+ 1. Let |promise| be [=a new promise=] created in [=this=] 's [=relevant realm=] .
399+
3984001. Let |signal| be |options|'s {{ModelContextRegisterToolOptions/signal}} .
399401
4004021. If |signal| [=map/exists=] , then:
401403
402- 1. If |signal| is [=AbortSignal/aborted=] , then optionally [=report a warning to the console=]
403- indicating that the tool was not registered because the {{AbortSignal}} was already
404- [=AbortSignal/aborted=] , and return.
404+ 1. If |signal| is [=AbortSignal/aborted=] , then return [=a promise rejected with=]
405+ |signal|'s [=AbortSignal/abort reason=] .
406+
407+ 1. [=AbortSignal/add|Add the following abort steps=] to |signal|:
405408
406- 1. [=AbortSignal/add|Add an abort algorithm=] to |signal| that [=model context/unregisters a
407- tool=] given [=this=] and |tool name|.
409+ 1. [=model context/Unregister a tool=] given [=this=] and |tool name|.
410+
411+ 1. [=Reject=] |promise| with |signal|'s [=AbortSignal/abort reason=] .
408412
4094131. Let |exposed origins| be an empty [=list=] of [=origins=] .
410414
@@ -448,8 +452,6 @@ The <dfn method for=ModelContext>registerTool(<var>tool</var>, <var>options</var
448452
4494531. Set [=this=] 's [=ModelContext/internal context=] [|tool name|] to |tool definition|.
450454
451- 1. Let |promise| be [=a new promise=] created in [=this=] 's [=relevant realm=] .
452-
4534551. Run the following steps [=in parallel=] :
454456
455457 1. [=Notify documents of a tool change=] given |tool owner| and |exposed origins|.
0 commit comments