Skip to main content
Glama

workflow_run

Run one JavaScript script that performs multiple web and desktop steps in a single call, returning the values you need. Save successful scripts as reusable routines for repeatable tasks.

Instructions

Run one JavaScript script that does many web and desktop steps in one call (web., desktop., visible.*). Write the whole task as one script; return the value you need. Use args for values that change. save keeps a script that succeeded as a named routine.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "script": "<script>"
    },
    "name": "workflow_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoValues the script reads as args.NAME.
modeNoHow the user sees the work: background (default, mouse and keyboard untouched), watch (on screen at a human pace, amber pointer), record (on screen at a human pace, the user's own pointer), direct (real input whenever a step needs it). Leave it out unless the user asked for one; saved preferences apply otherwise.
saveNoSave the script as a routine under this name after it succeeds.
aboutNoOne sentence on what the saved routine does.
detachNoHand the work to the resident host and get a job id at once; follow it with workflow_job (action wait). Use it for work longer than about 20 seconds.
paramsNoFor save: argument name to a short description of what it is.
scriptYesThe script body (JavaScript, top-level await allowed).
browserNoWhich browser web steps use, separate from mode: clean (a private window with no sign-ins), chrome (the user's own Chrome with their sign-ins, in its own tab; it stays behind unless mode puts work on screen; workflow_connect once), space (the agent's own profile signed in once). Leave it out to use the saved preference.
replaceNoFor save: replace a routine with the same name.
sessionNoA named agent-browser session instead of browser; never one that was connected to the user's Chrome.
timeout_msNoHow long the script may run, default 120000.
allow_finalNoLet send, submit, pay, delete and post steps go through. Only when the user asked for that step in this request or agreed in this chat.
allow_inputNoLet steps use the real mouse and keyboard. Only after the user agreed in this chat, or said so in this request.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose that saved scripts become named routines and that the script's return value is the result. However, it omits the safety and side-effect profile of a tool that can drive real mouse/keyboard and submit payments or deletions; that context is only recoverable from the parameter descriptions.

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

Conciseness4/5

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

Four short, front-loaded sentences with no filler; the core instruction to write one script comes first and the supporting notes follow. The parenthetical namespace list is terse to the point of being cryptic but costs little.

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

Completeness3/5

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

A 13-parameter, mutation-capable tool with no output schema needs more than this: the description never characterizes the return value beyond 'return the value you need', nor how execution failures surface. What is present is accurate and well-targeted, but an agent must read the schema to call this safely.

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; the description adds a little usable framing by explaining args as the channel for values that change and save as promoting a successful script to a routine. It still does not explain mode, browser vs session, or timeout semantics, deferring entirely to the schema.

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

Purpose4/5

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

States a specific verb and resource: 'Run one JavaScript script that does many web and desktop steps in one call', and names the API namespaces (web.*, desktop.*, visible.*). It is clearly distinct from narrower siblings, but it never explicitly routes the agent away from workflow_routine_run or workflow_watch, so differentiation is inferred rather than stated.

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

Usage Guidelines3/5

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

Gives script-authoring guidance ('Write the whole task as one script', 'Use args for values that change') but no when-to-use/when-not framing relative to alternatives. The genuinely useful selection hints (detach for work over ~20 seconds, allow_final/allow_input gating) live in the schema descriptions, not the tool description.

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