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/register_tool_with_empty_annotation.https.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html>
<head>
<title>WebMCP registerTool succeeds with empty annotations</title>
<link rel="author" href="mailto:dom@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
test(() => {
const tool = {
name: 'echo',
description: 'echo input',
execute: (obj) => obj.text,
annotations: {
// No `readOnlyHint` member.
},
};
const controller = new AbortController();
document.modelContext.registerTool(tool, { signal: controller.signal });
controller.abort();
}, 'register tool with empty annotations');
</script>
</body>
</html>