Skip to main content
Glama

batch_execute

Run up to 10 browser automation steps in one call for known linear flows like login or form fill, reducing round trips and stopping at the first failing step.

Instructions

Run up to 10 steps in one call. Supported actions: navigate, wait_for_element, wait_for_page, click, type, select_option, and execute_script, each with the same fields as the standalone tool (selectors only, not capture_page refs). Use it for known linear flows such as a login or form fill, to save round trips. By default it stops at the first failing step; the result lists every executed step with its details or error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stepsYesOrdered steps, 1-10. Each has an action plus that action's fields, e.g. { action: 'type', selector: { by: 'id', value: 'user-name' }, text: 'standard_user' }.
stopOnErrorNoStop at the first failing step (default true). Set false to run every step and collect all errors.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.3.0
    • addedInput schema / properties / steps / description
      Added value: +"Ordered steps, 1-10. Each has an action plus that action's fields, e.g. { action: 'type', selector: { by: 'id', value: 'user-name' }, text: 'standard_user' }."
    • changedInput schema / properties / steps / items / oneOf
      Previous value: -[
      -  {
      -    "properties": {
      -      "action": {
      -        "const": "navigate",
      -        "type": "string"
      -      },
      -      "url": {
      -        "format": "uri",
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "action",
      -      "url"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "action": {
      -        "const": "wait_for_element",
      -        "type": "string"
      -      },
      -      "selector": {
      -        "properties": {
      -          "by": {
      -            "enum": [
      -              "css",
      -              "xpath",
      -              "id",
      -              "name",
      -              "class",
      -              "className",
      -              "tag",
      -              "tagName",
      -              "linkText",
      -              "partialLinkText"
      -            ],
      -            "type": "string"
      -          },
      -          "value": {
      -            "minLength": 1,
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "by",
      -          "value"
      -        ],
      -        "type": "object"
      -      },
      -      "timeoutMs": {
      -        "default": 10000,
      -        "maximum": 60000,
      -        "minimum": 100,
      -        "type": "integer"
      -      },
      -      "visible": {
      -        "default": false,
      -        "type": "boolean"
      -      }
      -    },
      -    "required": [
      -      "action",
      -      "selector"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "action": {
      -        "const": "click",
      -        "type": "string"
      -      },
      -      "selector": {
      -        "properties": {
      -          "by": {
      -            "enum": [
      -              "css",
      -              "xpath",
      -              "id",
      -              "name",
      -              "class",
      -              "className",
      -              "tag",
      -              "tagName",
      -              "linkText",
      -              "partialLinkText"
      -            ],
      -            "type": "string"
      -          },
      -          "value": {
      -            "minLength": 1,
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "by",
      -          "value"
      -        ],
      -        "type": "object"
      -      },
      -      "timeoutMs": {
      -        "default": 10000,
      -        "maximum": 60000,
      -        "minimum": 100,
      -        "type": "integer"
      -      }
      -    },
      -    "required": [
      -      "action",
      -      "selector"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "action": {
      -        "const": "type",
      -        "type": "string"
      -      },
      -      "clearFirst": {
      -        "default": true,
      -        "type": "boolean"
      -      },
      -      "selector": {
      -        "properties": {
      -          "by": {
      -            "enum": [
      -              "css",
      -              "xpath",
      -              "id",
      -              "name",
      -              "class",
      -              "className",
      -              "tag",
      -              "tagName",
      -              "linkText",
      -              "partialLinkText"
      -            ],
      -            "type": "string"
      -          },
      -          "value": {
      -            "minLength": 1,
      -            "type": "string"
      -          }
      -        },
      -        "required": [
      -          "by",
      -          "value"
      -        ],
      -        "type": "object"
      -      },
      -      "submit": {
      -        "default": false,
      -        "type": "boolean"
      -      },
      -      "text": {
      -        "type": "string"
      -      },
      -      "timeoutMs": {
      -        "default": 10000,
      -        "maximum": 60000,
      -        "minimum": 100,
      -        "type": "integer"
      -      }
      -    },
      -    "required": [
      -      "action",
      -      "selector",
      -      "text"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "properties": {
      -      "action": {
      -        "const": "execute_script",
      -        "type": "string"
      -      },
      -      "args": {
      -        "default": [],
      -        "items": {
      -          "$ref": "#/definitions/__schema0"
      -        },
      -        "type": "array"
      -      },
      -      "script": {
      -        "minLength": 1,
      -        "type": "string"
      -      }
      -    },
      -    "required": [
      -      "action",
      -      "script"
      -    ],
      -    "type": "object"
      -  }
      -]New value: +[
      +  {
      +    "properties": {
      +      "action": {
      +        "const": "navigate",
      +        "type": "string"
      +      },
      +      "url": {
      +        "format": "uri",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "action",
      +      "url"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "action": {
      +        "const": "wait_for_element",
      +        "type": "string"
      +      },
      +      "selector": {
      +        "description": "How to find the element, e.g. { by: 'css', value: '#login-button' } or { by: 'id', value: 'user-name' }. Prefer id, name, or a short CSS selector.",
      +        "properties": {
      +          "by": {
      +            "description": "Locator strategy: css, xpath, id, name, class/className, tag/tagName, linkText, or partialLinkText.",
      +            "enum": [
      +              "css",
      +              "xpath",
      +              "id",
      +              "name",
      +              "class",
      +              "className",
      +              "tag",
      +              "tagName",
      +              "linkText",
      +              "partialLinkText"
      +            ],
      +            "type": "string"
      +          },
      +          "value": {
      +            "description": "The locator for that strategy, e.g. '#login-button' for css, 'user-name' for id, or //button[@type=\"submit\"] for xpath.",
      +            "minLength": 1,
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "by",
      +          "value"
      +        ],
      +        "type": "object"
      +      },
      +      "timeoutMs": {
      +        "default": 10000,
      +        "description": "How long to wait for the element, in milliseconds (default 10000, max 60000).",
      +        "maximum": 60000,
      +        "minimum": 100,
      +        "type": "integer"
      +      },
      +      "visible": {
      +        "default": false,
      +        "type": "boolean"
      +      }
      +    },
      +    "required": [
      +      "action",
      +      "selector"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "action": {
      +        "const": "wait_for_page",
      +        "type": "string"
      +      },
      +      "timeoutMs": {
      +        "default": 10000,
      +        "description": "How long to wait for the element, in milliseconds (default 10000, max 60000).",
      +        "maximum": 60000,
      +        "minimum": 100,
      +        "type": "integer"
      +      },
      +      "titleContains": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "urlContains": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "urlMatches": {
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "action"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "action": {
      +        "const": "click",
      +        "type": "string"
      +      },
      +      "selector": {
      +        "description": "How to find the element, e.g. { by: 'css', value: '#login-button' } or { by: 'id', value: 'user-name' }. Prefer id, name, or a short CSS selector.",
      +        "properties": {
      +          "by": {
      +            "description": "Locator strategy: css, xpath, id, name, class/className, tag/tagName, linkText, or partialLinkText.",
      +            "enum": [
      +              "css",
      +              "xpath",
      +              "id",
      +              "name",
      +              "class",
      +              "className",
      +              "tag",
      +              "tagName",
      +              "linkText",
      +              "partialLinkText"
      +            ],
      +            "type": "string"
      +          },
      +          "value": {
      +            "description": "The locator for that strategy, e.g. '#login-button' for css, 'user-name' for id, or //button[@type=\"submit\"] for xpath.",
      +            "minLength": 1,
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "by",
      +          "value"
      +        ],
      +        "type": "object"
      +      },
      +      "timeoutMs": {
      +        "default": 10000,
      +        "description": "How long to wait for the element, in milliseconds (default 10000, max 60000).",
      +        "maximum": 60000,
      +        "minimum": 100,
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "action",
      +      "selector"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "action": {
      +        "const": "type",
      +        "type": "string"
      +      },
      +      "clearFirst": {
      +        "default": true,
      +        "type": "boolean"
      +      },
      +      "selector": {
      +        "description": "How to find the element, e.g. { by: 'css', value: '#login-button' } or { by: 'id', value: 'user-name' }. Prefer id, name, or a short CSS selector.",
      +        "properties": {
      +          "by": {
      +            "description": "Locator strategy: css, xpath, id, name, class/className, tag/tagName, linkText, or partialLinkText.",
      +            "enum": [
      +              "css",
      +              "xpath",
      +              "id",
      +              "name",
      +              "class",
      +              "className",
      +              "tag",
      +              "tagName",
      +              "linkText",
      +              "partialLinkText"
      +            ],
      +            "type": "string"
      +          },
      +          "value": {
      +            "description": "The locator for that strategy, e.g. '#login-button' for css, 'user-name' for id, or //button[@type=\"submit\"] for xpath.",
      +            "minLength": 1,
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "by",
      +          "value"
      +        ],
      +        "type": "object"
      +      },
      +      "submit": {
      +        "default": false,
      +        "type": "boolean"
      +      },
      +      "text": {
      +        "type": "string"
      +      },
      +      "timeoutMs": {
      +        "default": 10000,
      +        "description": "How long to wait for the element, in milliseconds (default 10000, max 60000).",
      +        "maximum": 60000,
      +        "minimum": 100,
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "action",
      +      "selector",
      +      "text"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "action": {
      +        "const": "select_option",
      +        "type": "string"
      +      },
      +      "index": {
      +        "maximum": 9007199254740991,
      +        "minimum": 0,
      +        "type": "integer"
      +      },
      +      "selector": {
      +        "description": "How to find the element, e.g. { by: 'css', value: '#login-button' } or { by: 'id', value: 'user-name' }. Prefer id, name, or a short CSS selector.",
      +        "properties": {
      +          "by": {
      +            "description": "Locator strategy: css, xpath, id, name, class/className, tag/tagName, linkText, or partialLinkText.",
      +            "enum": [
      +              "css",
      +              "xpath",
      +              "id",
      +              "name",
      +              "class",
      +              "className",
      +              "tag",
      +              "tagName",
      +              "linkText",
      +              "partialLinkText"
      +            ],
      +            "type": "string"
      +          },
      +          "value": {
      +            "description": "The locator for that strategy, e.g. '#login-button' for css, 'user-name' for id, or //button[@type=\"submit\"] for xpath.",
      +            "minLength": 1,
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "by",
      +          "value"
      +        ],
      +        "type": "object"
      +      },
      +      "text": {
      +        "type": "string"
      +      },
      +      "timeoutMs": {
      +        "default": 10000,
      +        "description": "How long to wait for the element, in milliseconds (default 10000, max 60000).",
      +        "maximum": 60000,
      +        "minimum": 100,
      +        "type": "integer"
      +      },
      +      "value": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "action",
      +      "selector"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "properties": {
      +      "action": {
      +        "const": "execute_script",
      +        "type": "string"
      +      },
      +      "args": {
      +        "default": [],
      +        "items": {
      +          "$ref": "#/definitions/__schema0"
      +        },
      +        "type": "array"
      +      },
      +      "script": {
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "action",
      +      "script"
      +    ],
      +    "type": "object"
      +  }
      +]
    • addedInput schema / properties / stopOnError / description
      Added value: +"Stop at the first failing step (default true). Set false to run every step and collect all errors."
  2. Addedv0.2.0

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden and does well: it discloses the 10-step cap, the default fail-fast semantics, that stopOnError can be flipped to collect all errors, and the result shape ('lists every executed step with its details or error'). It also flags a real constraint the schema cannot express — selectors only, no capture_page refs. It stops short of saying what happens to browser state after a mid-batch failure or whether a session must already exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, front-loaded with the capability and its limits before moving to usage and failure behavior. Every sentence carries distinct information — actions supported, when to prefer it, and what happens on failure — with no filler or repetition of the tool name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a complex orchestration tool with zero annotation coverage and no output schema, the definition covers the essentials: step cap, allowed actions, failure semantics, and result contents. The remaining gaps are the unstated preconditions (an active browser session) and the side effects left behind by a partially executed batch, which matter for a mutation-heavy tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds genuine meaning beyond the schema: it states the accepted action vocabulary, that step fields mirror the standalone tools, and — critically — that capture_page references are not valid selectors here, a restriction absent from the JSON Schema. The 1-10 bounds and stopOnError default are restated rather than added, which keeps this from a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and scope ('Run up to 10 steps in one call') and enumerates exactly which actions are batched (navigate, wait_for_element, wait_for_page, click, type, select_option, execute_script). By tying each action back to 'the same fields as the standalone tool', it cleanly distinguishes batch_execute from the ~38 single-step siblings like click, type, and select_option.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives a clear positive context — 'known linear flows such as a login or form fill, to save round trips' — which implicitly rules out flows that need branching or intermediate inspection. However, it never explicitly states when NOT to batch (e.g. when a later step depends on reading an earlier step's result, use the standalone tools), so the exclusion is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.