diff --git a/src/tools/ToolDefinition.ts b/src/tools/ToolDefinition.ts index d017640cd..20c3c2e26 100644 --- a/src/tools/ToolDefinition.ts +++ b/src/tools/ToolDefinition.ts @@ -24,6 +24,16 @@ export interface ToolDefinition< * If true, the tool does not modify its environment. */ readOnlyHint: boolean; + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + */ + destructiveHint?: boolean; + /** + * If true, this tool may interact with an "open world" of external + * entities (e.g., websites, APIs, external services). + */ + openWorldHint?: boolean; }; schema: Schema; handler: ( diff --git a/src/tools/console.ts b/src/tools/console.ts index 9c3d145bb..05d339f08 100644 --- a/src/tools/console.ts +++ b/src/tools/console.ts @@ -43,6 +43,7 @@ export const listConsoleMessages = defineTool({ annotations: { category: ToolCategory.DEBUGGING, readOnlyHint: true, + openWorldHint: true, }, schema: { pageSize: zod @@ -91,6 +92,7 @@ export const getConsoleMessage = defineTool({ annotations: { category: ToolCategory.DEBUGGING, readOnlyHint: true, + openWorldHint: true, }, schema: { msgid: zod diff --git a/src/tools/emulation.ts b/src/tools/emulation.ts index 13119250d..cb04befe9 100644 --- a/src/tools/emulation.ts +++ b/src/tools/emulation.ts @@ -21,6 +21,7 @@ export const emulate = defineTool({ annotations: { category: ToolCategory.EMULATION, readOnlyHint: false, + openWorldHint: true, }, schema: { networkConditions: zod diff --git a/src/tools/input.ts b/src/tools/input.ts index 505568922..a9aea5aca 100644 --- a/src/tools/input.ts +++ b/src/tools/input.ts @@ -18,6 +18,7 @@ export const click = defineTool({ annotations: { category: ToolCategory.INPUT, readOnlyHint: false, + openWorldHint: true, }, schema: { uid: zod @@ -57,6 +58,7 @@ export const hover = defineTool({ annotations: { category: ToolCategory.INPUT, readOnlyHint: false, + openWorldHint: true, }, schema: { uid: zod @@ -141,6 +143,7 @@ export const fill = defineTool({ annotations: { category: ToolCategory.INPUT, readOnlyHint: false, + openWorldHint: true, }, schema: { uid: zod @@ -169,6 +172,7 @@ export const drag = defineTool({ annotations: { category: ToolCategory.INPUT, readOnlyHint: false, + openWorldHint: true, }, schema: { from_uid: zod.string().describe('The uid of the element to drag'), @@ -198,6 +202,7 @@ export const fillForm = defineTool({ annotations: { category: ToolCategory.INPUT, readOnlyHint: false, + openWorldHint: true, }, schema: { elements: zod @@ -230,6 +235,7 @@ export const uploadFile = defineTool({ annotations: { category: ToolCategory.INPUT, readOnlyHint: false, + openWorldHint: true, }, schema: { uid: zod @@ -278,6 +284,7 @@ export const pressKey = defineTool({ annotations: { category: ToolCategory.INPUT, readOnlyHint: false, + openWorldHint: true, }, schema: { key: zod diff --git a/src/tools/network.ts b/src/tools/network.ts index d3b6c1fe6..3918e4f31 100644 --- a/src/tools/network.ts +++ b/src/tools/network.ts @@ -38,6 +38,7 @@ export const listNetworkRequests = defineTool({ annotations: { category: ToolCategory.NETWORK, readOnlyHint: true, + openWorldHint: true, }, schema: { pageSize: zod @@ -92,6 +93,7 @@ export const getNetworkRequest = defineTool({ annotations: { category: ToolCategory.NETWORK, readOnlyHint: true, + openWorldHint: true, }, schema: { reqid: zod diff --git a/src/tools/pages.ts b/src/tools/pages.ts index 96ab2cc01..8975ae9dc 100644 --- a/src/tools/pages.ts +++ b/src/tools/pages.ts @@ -16,6 +16,7 @@ export const listPages = defineTool({ annotations: { category: ToolCategory.NAVIGATION, readOnlyHint: true, + openWorldHint: true, }, schema: {}, handler: async (_request, response) => { @@ -29,6 +30,7 @@ export const selectPage = defineTool({ annotations: { category: ToolCategory.NAVIGATION, readOnlyHint: true, + openWorldHint: true, }, schema: { pageIdx: zod @@ -57,6 +59,7 @@ export const closePage = defineTool({ annotations: { category: ToolCategory.NAVIGATION, readOnlyHint: false, + openWorldHint: true, }, schema: { pageIdx: zod @@ -85,6 +88,7 @@ export const newPage = defineTool({ annotations: { category: ToolCategory.NAVIGATION, readOnlyHint: false, + openWorldHint: true, }, schema: { url: zod.string().describe('URL to load in a new page.'), @@ -109,6 +113,7 @@ export const navigatePage = defineTool({ annotations: { category: ToolCategory.NAVIGATION, readOnlyHint: false, + openWorldHint: true, }, schema: { type: zod @@ -205,6 +210,7 @@ export const resizePage = defineTool({ annotations: { category: ToolCategory.EMULATION, readOnlyHint: false, + openWorldHint: true, }, schema: { width: zod.number().describe('Page width'), @@ -229,6 +235,7 @@ export const handleDialog = defineTool({ annotations: { category: ToolCategory.INPUT, readOnlyHint: false, + openWorldHint: true, }, schema: { action: zod diff --git a/src/tools/performance.ts b/src/tools/performance.ts index a8b24903c..0bbe0d007 100644 --- a/src/tools/performance.ts +++ b/src/tools/performance.ts @@ -26,6 +26,7 @@ export const startTrace = defineTool({ annotations: { category: ToolCategory.PERFORMANCE, readOnlyHint: true, + openWorldHint: true, }, schema: { reload: zod @@ -107,6 +108,7 @@ export const stopTrace = defineTool({ annotations: { category: ToolCategory.PERFORMANCE, readOnlyHint: true, + openWorldHint: true, }, schema: {}, handler: async (_request, response, context) => { @@ -125,6 +127,7 @@ export const analyzeInsight = defineTool({ annotations: { category: ToolCategory.PERFORMANCE, readOnlyHint: true, + openWorldHint: true, }, schema: { insightSetId: zod diff --git a/src/tools/screenshot.ts b/src/tools/screenshot.ts index 4312c02aa..ecd94ff33 100644 --- a/src/tools/screenshot.ts +++ b/src/tools/screenshot.ts @@ -17,6 +17,7 @@ export const screenshot = defineTool({ category: ToolCategory.DEBUGGING, // Not read-only due to filePath param. readOnlyHint: false, + openWorldHint: true, }, schema: { format: zod diff --git a/src/tools/script.ts b/src/tools/script.ts index de28fe0b4..33d096267 100644 --- a/src/tools/script.ts +++ b/src/tools/script.ts @@ -17,6 +17,7 @@ so returned values have to JSON-serializable.`, annotations: { category: ToolCategory.DEBUGGING, readOnlyHint: false, + openWorldHint: true, }, schema: { function: zod.string().describe( diff --git a/src/tools/snapshot.ts b/src/tools/snapshot.ts index 143d04093..2a24f2e47 100644 --- a/src/tools/snapshot.ts +++ b/src/tools/snapshot.ts @@ -18,6 +18,7 @@ in the DevTools Elements panel (if any).`, category: ToolCategory.DEBUGGING, // Not read-only due to filePath param. readOnlyHint: false, + openWorldHint: true, }, schema: { verbose: zod @@ -47,6 +48,7 @@ export const waitFor = defineTool({ annotations: { category: ToolCategory.NAVIGATION, readOnlyHint: true, + openWorldHint: true, }, schema: { text: zod.string().describe('Text to appear on the page'),