From de860ca094728cc316b62c59940c365e77a05ad9 Mon Sep 17 00:00:00 2001 From: robertjamesprior <83608739+robertjamesprior@users.noreply.github.com> Date: Thu, 17 Sep 2026 09:25:38 +0000 Subject: [PATCH] Make the execution ladder legible from every rung webmcp already tells a caller to fall back to execute_playwright_code or computer_action when a site offers no tools of its own. The other three say nothing about each other, so a model picking between them has to already know the order. manage_browsers now names the three ways to drive a session it creates. execute_playwright_code says when to prefer it over webmcp and when to drop to computer_action. computer_action says it is the last resort rather than describing itself as executing computer actions. Operational detail in all three is unchanged. Co-Authored-By: Claude Opus 5 --- src/lib/mcp/tools/browsers.ts | 2 +- src/lib/mcp/tools/computer-action.ts | 2 +- src/lib/mcp/tools/playwright.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/mcp/tools/browsers.ts b/src/lib/mcp/tools/browsers.ts index c6d0646..9843304 100644 --- a/src/lib/mcp/tools/browsers.ts +++ b/src/lib/mcp/tools/browsers.ts @@ -434,7 +434,7 @@ export function registerBrowserCapabilities( // manage_browsers -- Manage browser sessions and read archived telemetry server.tool( "manage_browsers", - 'Manage browser sessions and their archived telemetry. Use "list" to choose an existing session, "create" before browser control, "update" to change supported session settings, "get" for full details, "get_telemetry" to diagnose active or deleted sessions, and "delete" when finished. Live sessions can be addressed by ID or by the name given at creation or set on update; deleted sessions only by ID. get_telemetry compacts events by default; set compact=false with explicit categories and a limit of at most 5 when raw headers, request data, response bodies, or other omitted fields are needed.', + 'Create and manage the browser sessions that every web task runs in, and read their archived telemetry. Once a session exists, drive it with webmcp, execute_playwright_code, or computer_action, in that order of preference. Use "list" to choose an existing session, "create" before browser control, "update" to change supported session settings, "get" for full details, "get_telemetry" to diagnose active or deleted sessions, and "delete" when finished. Live sessions can be addressed by ID or by the name given at creation or set on update; deleted sessions only by ID. get_telemetry compacts events by default; set compact=false with explicit categories and a limit of at most 5 when raw headers, request data, response bodies, or other omitted fields are needed.', { ...projectSelectionInputSchema(), action: z diff --git a/src/lib/mcp/tools/computer-action.ts b/src/lib/mcp/tools/computer-action.ts index 92157f5..6e9f806 100644 --- a/src/lib/mcp/tools/computer-action.ts +++ b/src/lib/mcp/tools/computer-action.ts @@ -256,7 +256,7 @@ export function registerComputerActionTool(server: McpServer) { // computer_action -- Execute one or more computer actions on a browser session server.tool( "computer_action", - "Execute computer actions on a browser session. Pass a single action for simple operations (e.g. one click or one screenshot), or pass multiple actions to batch them into a single request for lower latency (e.g. click, type, press_key in one call). Use sleep actions between steps when the page needs time to react (e.g. after a click that triggers navigation or animation). IMPORTANT: Always include a screenshot as the last action so you can see the result of your actions. Action types: click_mouse, move_mouse, type_text, press_key, scroll, drag_mouse, set_cursor, sleep, write_clipboard, read_clipboard, screenshot, get_mouse_position. screenshot, read_clipboard, and get_mouse_position return data, so they must be the last action if included.", + "Control a page visually, by clicking and typing at coordinates and reading the screen. Use this only when the DOM cannot drive the page: prefer webmcp where a site offers its own tools, then execute_playwright_code. Pass a single action for simple operations (e.g. one click or one screenshot), or pass multiple actions to batch them into a single request for lower latency (e.g. click, type, press_key in one call). Use sleep actions between steps when the page needs time to react (e.g. after a click that triggers navigation or animation). IMPORTANT: Always include a screenshot as the last action so you can see the result of your actions. Action types: click_mouse, move_mouse, type_text, press_key, scroll, drag_mouse, set_cursor, sleep, write_clipboard, read_clipboard, screenshot, get_mouse_position. screenshot, read_clipboard, and get_mouse_position return data, so they must be the last action if included.", { ...projectSelectionInputSchema(), session_id: z.string().describe("Browser session ID or name."), diff --git a/src/lib/mcp/tools/playwright.ts b/src/lib/mcp/tools/playwright.ts index c529ddc..96c2b49 100644 --- a/src/lib/mcp/tools/playwright.ts +++ b/src/lib/mcp/tools/playwright.ts @@ -25,7 +25,7 @@ export function registerPlaywrightTool( // execute_playwright_code -- Run Playwright/TypeScript code against a browser server.tool( "execute_playwright_code", - "Execute Playwright/TypeScript automation or browser-wide WebMCP helpers against an existing Kernel browser session. Does not create or delete browsers -- use manage_browsers to manage session lifecycle.", + "Drive a page through the DOM, using Playwright/TypeScript automation or browser-wide WebMCP helpers, against an existing Kernel browser session. Use this when a site exposes no WebMCP tools of its own, and fall back to computer_action only when the DOM cannot drive the page. Does not create or delete browsers -- use manage_browsers to manage session lifecycle.", { ...projectSelectionInputSchema(), code: z