@tontoko/fast-playwright-mcp 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,7 +42,8 @@ class BatchExecutor {
42
42
  for (const [index, step] of steps.entries()) {
43
43
  const tool = this.toolRegistry.get(step.tool);
44
44
  if (!tool) {
45
- throw new Error(`Unknown tool: ${step.tool}`);
45
+ const availableTools = Array.from(this.toolRegistry.keys()).filter((name) => name.startsWith("browser_") && name !== "browser_batch_execute").sort((a, b) => a.localeCompare(b)).join(",");
46
+ throw new Error(`Unknown tool: "${step.tool}" at step ${index}. Available tools: ${availableTools}`);
46
47
  }
47
48
  try {
48
49
  const parseResult = tool.schema.inputSchema.safeParse({
@@ -23,7 +23,7 @@ import { expectationSchema } from "../schemas/expectation.js";
23
23
  import { getErrorMessage } from "../utils/common-formatters.js";
24
24
  var baseElementSchema = z.object({
25
25
  element: z.string().optional().describe("Human-readable element description used to obtain permission to interact with the element"),
26
- ref: z.string().optional().describe("Exact target element reference from the page snapshot")
26
+ ref: z.string().optional().describe('System-generated element ID from previous tool results (e.g., "rNODE-45-1"). Never use custom values.')
27
27
  });
28
28
  var baseExpectationSchema = z.object({
29
29
  expectation: expectationSchema
@@ -26,7 +26,7 @@ var batchExecuteTool = defineTool({
26
26
  schema: {
27
27
  name: "browser_batch_execute",
28
28
  title: "Batch Execute Browser Actions",
29
- description: `Execute multiple browser actions in sequence with optimized response handling.RECOMMENDED:Use this tool instead of individual actions when performing multiple operations to significantly reduce token usage and improve performance.BY DEFAULT use for:form filling(multiple type→click),multi-step navigation,any workflow with 2+ known steps.Saves 90% tokens vs individual calls.globalExpectation:{includeSnapshot:false,snapshotOptions:{selector:"#app"},diffOptions:{enabled:true}}.Per-step override:steps[].expectation.Example:[{tool:"browser_navigate",arguments:{url:"https://example.com"}},{tool:"browser_type",arguments:{element:"username",ref:"#user",text:"john"}},{tool:"browser_click",arguments:{element:"submit",ref:"#btn"}}].`,
29
+ description: `Execute multiple browser actions in sequence with optimized response handling.RECOMMENDED:Use this tool instead of individual actions when performing multiple operations to significantly reduce token usage and improve performance.BY DEFAULT use for:form filling(multiple type→click),multi-step navigation,any workflow with 2+ known steps.Saves 90% tokens vs individual calls.globalExpectation:{includeSnapshot:false,snapshotOptions:{selector:"#app"},diffOptions:{enabled:true}}.Per-step override:steps[].expectation.Example:[{tool:"browser_navigate",arguments:{url:"https://example.com"}},{tool:"browser_type",arguments:{element:"username",ref:"#user",text:"john"}},{tool:"browser_click",arguments:{element:"submit",ref:"#btn"}}].Tool names must match exactly(e.g.browser_navigate,browser_click,browser_type).`,
30
30
  inputSchema: batchExecuteSchema,
31
31
  type: "destructive"
32
32
  },
@@ -26,7 +26,7 @@ import { generateLocator } from "./utils.js";
26
26
  var evaluateSchema = z.object({
27
27
  function: z.string().describe("() => { /* code */ } or (element) => { /* code */ } when element is provided"),
28
28
  element: z.string().optional().describe("Human-readable element description used to obtain permission to interact with the element"),
29
- ref: z.string().optional().describe("Exact target element reference from the page snapshot"),
29
+ ref: z.string().optional().describe('System-generated element ID from previous tool results (e.g., "rNODE-45-1"). Never use custom values.'),
30
30
  expectation: expectationSchema
31
31
  });
32
32
  var evaluate = defineTabTool({
@@ -51,7 +51,7 @@ var pressKey = defineTabTool({
51
51
  });
52
52
  var typeSchema = elementSchema.extend({
53
53
  element: z.string().describe("Human-readable element description used to obtain permission to interact with the element"),
54
- ref: z.string().describe("Exact target element reference from the page snapshot"),
54
+ ref: z.string().describe('System-generated element ID from previous tool results (e.g., "rNODE-45-1"). Never use custom values.'),
55
55
  text: z.string().describe("Text to type into the element"),
56
56
  submit: z.boolean().optional().describe("Whether to submit entered text (press Enter after)"),
57
57
  slowly: z.boolean().optional().describe("Whether type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once."),
@@ -27,7 +27,7 @@ var screenshotSchema = z.object({
27
27
  type: z.enum(["png", "jpeg"]).default("png").describe("Image format for the screenshot. Default is png."),
28
28
  filename: z.string().optional().describe("File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified."),
29
29
  element: z.string().optional().describe("Human-readable element description used to obtain permission to screenshot the element. If not provided, the screenshot will be taken of viewport. If element is provided, ref must be provided too."),
30
- ref: z.string().optional().describe("Exact target element reference from the page snapshot. If not provided, the screenshot will be taken of viewport. If ref is provided, element must be provided too."),
30
+ ref: z.string().optional().describe('System-generated element ID from previous tool results (e.g., "rNODE-45-1"). Never use custom values. If not provided, the screenshot will be taken of viewport. If ref is provided, element must be provided too.'),
31
31
  fullPage: z.boolean().optional().describe("When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Cannot be used with element screenshots."),
32
32
  expectation: expectationSchema
33
33
  }).refine((data) => {
@@ -47,7 +47,7 @@ var snapshot = defineTool({
47
47
  });
48
48
  var elementSchema = z.object({
49
49
  element: z.string().describe("Human-readable element description used to obtain permission to interact with the element"),
50
- ref: z.string().describe("Exact target element reference from the page snapshot")
50
+ ref: z.string().describe('System-generated element ID from previous tool results (e.g., "rNODE-45-1"). Never use custom values.')
51
51
  });
52
52
  var clickSchema = elementSchema.extend({
53
53
  doubleClick: z.boolean().optional().describe("Whether to perform a double click instead of a single click"),
@@ -93,9 +93,9 @@ var drag = defineTabTool({
93
93
  description: `Perform drag and drop between two elements.expectation:{includeSnapshot:true,snapshotOptions:{selector:".drop-zone"}} to verify drop result.diffOptions:{enabled:true} shows only what moved.CONSIDER batch_execute if part of larger workflow.`,
94
94
  inputSchema: z.object({
95
95
  startElement: z.string().describe("Human-readable source element description used to obtain the permission to interact with the element"),
96
- startRef: z.string().describe("Exact source element reference from the page snapshot"),
96
+ startRef: z.string().describe('System-generated source element ID from previous tool results (e.g., "rNODE-45-1"). Never use custom values.'),
97
97
  endElement: z.string().describe("Human-readable target element description used to obtain the permission to interact with the element"),
98
- endRef: z.string().describe("Exact target element reference from the page snapshot"),
98
+ endRef: z.string().describe('System-generated target element ID from previous tool results (e.g., "rNODE-45-1"). Never use custom values.'),
99
99
  expectation: expectationSchema
100
100
  }),
101
101
  type: "destructive"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tontoko/fast-playwright-mcp",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },