Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /webmcp/imperative/duplicate_tool_registration.https.window.html - WPT Dashboard Interop Dashboard
'use strict';
test(() => {
function empty() {
return 'empty';
}
assert_throws_dom(
'InvalidStateError',
() => {
navigator.modelContext.registerTool({
name: 'empty',
description: 'echo empty',
execute: empty,
});
navigator.modelContext.registerTool({
name: 'empty',
description: 'echo empty',
execute: empty,
});
},
'duplicate tool registration is invalid.',
);
}, 'duplicate tool registration is invalid.');