Skip to main content
Glama

run_script

Run deterministic multi-step browser scripts with loops, conditionals, and error handling on a cloned tab to automate repetitive page operations.

Instructions

Execute a deterministic multi-step script without per-step LLM round-trips, running on a cloned browser tab. Scripts support loops (for/while/forEach), conditionals (if/else), error handling (try/catch), parallel branches, and variable capture. Returns a script_id immediately — use wait_for_scripts to collect results. Provide either an inline script definition or a name to load a previously saved script. Use when you detect a repetitive pattern (same operation on 3+ pages/items).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitsNoOverride default execution limits. Keys: max_steps (int), max_timeout_secs (int), max_output_bytes (int), max_parallel_branches (int), per_step_timeout_secs (int).
nameNoName of a previously saved script to run (alternative to inline 'script'). Mutually exclusive with 'script' — provide one or the other.
save_asNoSave the script under this name after execution for future reuse (alphanumeric + underscore). Persists to ~/.acrawl/scripts/<name>.json.
scriptNoInline script definition object. Must include: version ("1.0"), steps (array of node objects: ToolCall, Assign, Collect, Yield, ForLoop, ForEach, WhileLoop, IfElse, TryCatch, Parallel), and optional limits. Use instead of 'name' for new scripts.
Behavior4/5

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

No annotations provided, so description carries full burden. It explains the tool is deterministic, runs on a cloned tab, returns script_id immediately, supports loops, conditionals, error handling, and parallel branches. Could mention cancellation via cancel_script, but overall transparent.

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?

Two paragraphs: first describes what the tool does and its capabilities, second gives usage context. Every sentence serves a purpose, no redundancy. Front-loaded with key action and immediate result.

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?

No output schema, but description explains return value (script_id) and how to get results (wait_for_scripts). Covers supported constructs and parameter options. Lacks explicit mention of error handling beyond try/catch, but sufficient for usage.

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% (baseline 3), but description adds context: explains name and script are mutually exclusive, save_as persists to disk, limits override defaults, and script must include version and steps. This adds meaningful value beyond the schema.

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 uses specific verb+resource: 'Execute a deterministic multi-step script without per-step LLM round-trips, running on a cloned browser tab.' It clearly distinguishes from sibling tools by specifying it's for repetitive patterns and mentions control flow constructs, making its unique purpose unmistakable.

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?

Provides explicit when-to-use guidance: 'Use when you detect a repetitive pattern (same operation on 3+ pages/items).' Also implies alternatives: use wait_for_scripts for results, and that you can provide inline or saved script. Does not explicitly state when not to use, but sufficient for most agents.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Mingye-Lu/AgenticCrawler'

If you have feedback or need assistance with the MCP directory API, please join our Discord server