diff --git a/index.bs b/index.bs index 4274a31..266ed04 100644 --- a/index.bs +++ b/index.bs @@ -407,6 +407,20 @@ The registerTool(tool, options +1. Let |exposed origins| be an empty [=list=] of [=origins=]. + +1. If |options|'s {{ModelContextRegisterToolOptions/exposedTo}} [=map/exists=], then: + + 1. [=list/For each=] |origin| of |options|'s {{ModelContextRegisterToolOptions/exposedTo}}: + + 1. Let |parsedURL| be the result of running the [=URL parser=] on |origin|. + + 1. If |parsedURL| is failure or its [=url/origin=] is not [$is origin potentially + trustworthy?|potentially trustworthy$], then return [=a promise rejected with=] a + "{{SecurityError}}" {{DOMException}}. + + 1. [=list/Append=] |parsedURL|'s [=url/origin=] to |exposed origins|. + 1. Let |promise| be [=a new promise=] created in [=this=]'s [=relevant realm=]. 1. If |options|'s {{ModelContextRegisterToolOptions/signal}} [=map/exists=], then: @@ -422,20 +436,6 @@ The registerTool(tool, options dictionary ModelContextRegisterToolOptions { - AbortSignal signal; sequence exposedTo; + AbortSignal signal; };
+ : options["{{ModelContextRegisterToolOptions/exposedTo}}"] + :: An array of origins that control which documents this tool is exposed to, in the current document's tree. + : options["{{ModelContextRegisterToolOptions/signal}}"] :: An {{AbortSignal}} that unregisters the tool when aborted. - - : options["{{ModelContextRegisterToolOptions/exposedTo}}"] - ::

An array of origins that control which documents this tool is exposed to, in the current document's tree.

ModelContextGetToolOptions Dictionary