Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/tools/ToolDefinition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: (
Expand Down
2 changes: 2 additions & 0 deletions src/tools/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const listConsoleMessages = defineTool({
annotations: {
category: ToolCategory.DEBUGGING,
readOnlyHint: true,
openWorldHint: true,
},
schema: {
pageSize: zod
Expand Down Expand Up @@ -91,6 +92,7 @@ export const getConsoleMessage = defineTool({
annotations: {
category: ToolCategory.DEBUGGING,
readOnlyHint: true,
openWorldHint: true,
},
schema: {
msgid: zod
Expand Down
1 change: 1 addition & 0 deletions src/tools/emulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const emulate = defineTool({
annotations: {
category: ToolCategory.EMULATION,
readOnlyHint: false,
openWorldHint: true,
},
schema: {
networkConditions: zod
Expand Down
7 changes: 7 additions & 0 deletions src/tools/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const click = defineTool({
annotations: {
category: ToolCategory.INPUT,
readOnlyHint: false,
openWorldHint: true,
},
schema: {
uid: zod
Expand Down Expand Up @@ -57,6 +58,7 @@ export const hover = defineTool({
annotations: {
category: ToolCategory.INPUT,
readOnlyHint: false,
openWorldHint: true,
},
schema: {
uid: zod
Expand Down Expand Up @@ -141,6 +143,7 @@ export const fill = defineTool({
annotations: {
category: ToolCategory.INPUT,
readOnlyHint: false,
openWorldHint: true,
},
schema: {
uid: zod
Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -198,6 +202,7 @@ export const fillForm = defineTool({
annotations: {
category: ToolCategory.INPUT,
readOnlyHint: false,
openWorldHint: true,
},
schema: {
elements: zod
Expand Down Expand Up @@ -230,6 +235,7 @@ export const uploadFile = defineTool({
annotations: {
category: ToolCategory.INPUT,
readOnlyHint: false,
openWorldHint: true,
},
schema: {
uid: zod
Expand Down Expand Up @@ -278,6 +284,7 @@ export const pressKey = defineTool({
annotations: {
category: ToolCategory.INPUT,
readOnlyHint: false,
openWorldHint: true,
},
schema: {
key: zod
Expand Down
2 changes: 2 additions & 0 deletions src/tools/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const listNetworkRequests = defineTool({
annotations: {
category: ToolCategory.NETWORK,
readOnlyHint: true,
openWorldHint: true,
},
schema: {
pageSize: zod
Expand Down Expand Up @@ -92,6 +93,7 @@ export const getNetworkRequest = defineTool({
annotations: {
category: ToolCategory.NETWORK,
readOnlyHint: true,
openWorldHint: true,
},
schema: {
reqid: zod
Expand Down
7 changes: 7 additions & 0 deletions src/tools/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const listPages = defineTool({
annotations: {
category: ToolCategory.NAVIGATION,
readOnlyHint: true,
openWorldHint: true,
},
schema: {},
handler: async (_request, response) => {
Expand All @@ -29,6 +30,7 @@ export const selectPage = defineTool({
annotations: {
category: ToolCategory.NAVIGATION,
readOnlyHint: true,
openWorldHint: true,
},
schema: {
pageIdx: zod
Expand Down Expand Up @@ -57,6 +59,7 @@ export const closePage = defineTool({
annotations: {
category: ToolCategory.NAVIGATION,
readOnlyHint: false,
openWorldHint: true,
},
schema: {
pageIdx: zod
Expand Down Expand Up @@ -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.'),
Expand All @@ -109,6 +113,7 @@ export const navigatePage = defineTool({
annotations: {
category: ToolCategory.NAVIGATION,
readOnlyHint: false,
openWorldHint: true,
},
schema: {
type: zod
Expand Down Expand Up @@ -205,6 +210,7 @@ export const resizePage = defineTool({
annotations: {
category: ToolCategory.EMULATION,
readOnlyHint: false,
openWorldHint: true,
},
schema: {
width: zod.number().describe('Page width'),
Expand All @@ -229,6 +235,7 @@ export const handleDialog = defineTool({
annotations: {
category: ToolCategory.INPUT,
readOnlyHint: false,
openWorldHint: true,
},
schema: {
action: zod
Expand Down
3 changes: 3 additions & 0 deletions src/tools/performance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const startTrace = defineTool({
annotations: {
category: ToolCategory.PERFORMANCE,
readOnlyHint: true,
openWorldHint: true,
},
schema: {
reload: zod
Expand Down Expand Up @@ -107,6 +108,7 @@ export const stopTrace = defineTool({
annotations: {
category: ToolCategory.PERFORMANCE,
readOnlyHint: true,
openWorldHint: true,
},
schema: {},
handler: async (_request, response, context) => {
Expand All @@ -125,6 +127,7 @@ export const analyzeInsight = defineTool({
annotations: {
category: ToolCategory.PERFORMANCE,
readOnlyHint: true,
openWorldHint: true,
},
schema: {
insightSetId: zod
Expand Down
1 change: 1 addition & 0 deletions src/tools/screenshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/tools/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ so returned values have to JSON-serializable.`,
annotations: {
category: ToolCategory.DEBUGGING,
readOnlyHint: false,
openWorldHint: true,
},
schema: {
function: zod.string().describe(
Expand Down
2 changes: 2 additions & 0 deletions src/tools/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'),
Expand Down