chore: annotate tools (#351)

Fixes https://github.com/microsoft/playwright-mcp/issues/215
This commit is contained in:
Pavel Feldman
2025-05-05 17:38:22 -07:00
committed by GitHub
parent 8cd7d5a753
commit d01aa19ffa
19 changed files with 157 additions and 62 deletions

View File

@@ -22,10 +22,12 @@ const navigate: ToolFactory = captureSnapshot => defineTool({
schema: {
name: 'browser_navigate',
title: 'Navigate to a URL',
description: 'Navigate to a URL',
inputSchema: z.object({
url: z.string().describe('The URL to navigate to'),
}),
type: 'destructive',
},
handle: async (context, params) => {
@@ -49,8 +51,10 @@ const goBack: ToolFactory = captureSnapshot => defineTool({
capability: 'history',
schema: {
name: 'browser_navigate_back',
title: 'Go back',
description: 'Go back to the previous page',
inputSchema: z.object({}),
type: 'readOnly',
},
handle: async context => {
@@ -73,8 +77,10 @@ const goForward: ToolFactory = captureSnapshot => defineTool({
capability: 'history',
schema: {
name: 'browser_navigate_forward',
title: 'Go forward',
description: 'Go forward to the next page',
inputSchema: z.object({}),
type: 'readOnly',
},
handle: async context => {
const tab = context.currentTabOrDie();