Skip to main content
Glama

Run an ego-browser script

ego_run

Runs custom ESM Node scripts in the embedded ego-browser runtime, enabling top-level await and ego browser APIs to automate tasks beyond shortcut tools and return structured JSON data.

Instructions

Run an ego-browser (ego lite) Node script with the embedded runtime. The script is ESM with top-level await and can use taskSpace(name), task.page('p1'), page.goto(), page.snapshot(), page.click('ref=12') and the rest of the ego API. Print JSON to return structured data. Use this for anything the shortcut tools do not cover.

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": "ego_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
scriptYesFull ESM script text, executed by `ego-browser nodejs`.
timeoutMsNoHard timeout, default 120000.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior3/5

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

Annotations only declare readOnlyHint=false, so the description must carry the rest. It does add real value — the embedded runtime, the ego API surface available to the script, and the convention of printing JSON to return data — but it omits consequences: arbitrary code execution implications, failure/timeout behavior, and what happens to page state the script mutates.

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?

Three tight sentences, front-loaded with the core action and followed by the API capability list and the disambiguation rule. Every sentence earns its place; the API enumeration is slightly dense but functional rather than padding.

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 exists, and the description compensates by explaining that structured data is returned by printing JSON, which is the essential contract for this tool. It leaves error handling and sandbox/permission boundaries unstated, but for a two-parameter escape-hatch tool the core picture is complete.

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 goes beyond the schema by clarifying what belongs in `script` (ESM with top-level await, which API calls are legal) and how results are returned via printed JSON. Only `timeoutMs` is left entirely to 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?

States a specific verb and resource ("Run an ego-browser Node script with the embedded runtime") and immediately scopes it against the rest of the toolset with "anything the shortcut tools do not cover." The ESM/top-level-await detail further pins down what kind of script is expected.

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?

Gives a clear selection rule: use this when the shortcut tools don't cover the case, which is exactly the fallback decision an agent needs. It stops short of naming specific alternatives or when-not-to-use cases (e.g. simple navigation should prefer browser_navigate), so guidance is clear but not exhaustive.

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