Skip to content

Commit 660578a

Browse files
authored
Merge pull request #3 from TueJon/docs/spec-gettools-2026-07-21
docs: align ambient types with WebMCP getTools draft
2 parents b11c5ac + 3de9e07 commit 660578a

1 file changed

Lines changed: 15 additions & 11 deletions

File tree

skills/webmcpify/templates/webmcp.d.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
*
2626
* Full text: https://github.com/TueJon/webmcpify/blob/main/LICENSE
2727
*
28-
* registerTool/ontoolchange/annotations follow the CG draft
29-
* (https://webmachinelearning.github.io/webmcp/); getTools/executeTool are
30-
* Chrome-only extensions not yet in the draft. This API is in flux — re-check
31-
* against the draft and https://developer.chrome.com/docs/ai/webmcp when updating.
28+
* registerTool/ontoolchange/annotations/getTools follow the CG draft
29+
* (https://webmachinelearning.github.io/webmcp/); executeTool is a Chrome-only
30+
* extension not yet in the draft. This API is in flux — re-check against the
31+
* draft and https://developer.chrome.com/docs/ai/webmcp when updating.
3232
*
3333
* This is a GLOBAL script file — no imports (an import would turn it into a
3434
* module and un-globalize every interface). React JSX typings for the declarative
@@ -47,11 +47,14 @@ interface ModelContext extends EventTarget {
4747
): Promise<void>;
4848
ontoolchange: ((this: ModelContext, ev: Event) => unknown) | null;
4949
/**
50-
* Enumeration/execution surface — Chrome-only (2026-07+; NOT in the CG draft;
51-
* replaced the removed navigator.modelContextTesting). For agents and test
52-
* harnesses — never for application logic.
50+
* Enumerates tools exposed to this document. Added to the CG draft in 2026-07;
51+
* intended for in-page agents and test harnesses, not application logic.
52+
*/
53+
getTools(options?: { fromOrigins?: string[] }): Promise<RegisteredTool[]>;
54+
/**
55+
* Chrome-only execution surface (2026-07+; not yet in the CG draft); replaced
56+
* the removed navigator.modelContextTesting API.
5357
*/
54-
getTools?(options?: { fromOrigins?: string[] }): Promise<RegisteredTool[]>;
5558
executeTool?(
5659
tool: RegisteredTool,
5760
inputJson: string,
@@ -81,13 +84,14 @@ interface ModelContextTool {
8184
/** Shape returned by getTools(). NOTE inputSchema is a STRINGIFIED JSON Schema. */
8285
interface RegisteredTool {
8386
name: string;
84-
description?: string;
87+
title?: string;
88+
description: string;
8589
inputSchema?: string;
8690
annotations?: ModelContextToolAnnotations;
8791
/** Registering origin (secure origins only). */
88-
origin?: string;
92+
origin: string;
8993
/** Owning window (cross-document enumeration). */
90-
window?: Window | null;
94+
window: Window;
9195
}
9296

9397
interface Document {

0 commit comments

Comments
 (0)