Skip to main content
Glama

ie_js

Runs JavaScript in an Internet Explorer page or frame and returns the result, enabling scripted inspection and control of legacy IE-only web applications.

Instructions

Execute JavaScript in the page or a frame and return the result. Over COM (target hwnd:/tab:) the script runs as a function body in the frame's own window: write ES3 (no JSON, let, arrow functions), return a primitive or an array (arrays come back joined with the character U+001E); a script error is reported, never sent to the page's onerror.

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

Input Schema

NameRequiredDescriptionDefault
frameNo
limitNo
scriptYes
targetNoWhere to act: omit it for the session's IE driver; hwnd:<n> acts over COM on the window <n> (a modal dialog's hwnd from a NOTICE or ie_windows), tab:<n> on an attached tab. Over COM, DOM access is script, input is synthetic (script events and a timer click, not mouse or keyboard input; keys are posted window messages) and only id, name, tag, class, link_text and (documentMode 8+) css locators work.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the load and does well: it discloses that scripts run as a function body in the frame's own window, must be ES3, that arrays return joined by U+001E, and that script errors are reported rather than routed to the page's onerror. What it omits is that arbitrary JS can mutate page state (a destructive-capable operation) and that a limit may truncate execution or results.

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?

Purpose is front-loaded and every clause carries information — the ES3 restrictions and U+001E array delimiter are things an agent would otherwise get wrong. The single long COM sentence is dense but not padded; it could be split for readability.

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?

There is no output schema and no annotations, so the description is the only behavioral source. It covers return values and error surfacing well, but leaves frame and limit undocumented and does not warn that executed scripts can alter the page, which is material for an execute-anything tool.

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

Parameters3/5

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

Schema coverage is only 25% (only target is documented in-schema), so the description must compensate. It adds genuine meaning for script (ES3 subset, return-type constraints) and reinforces the hwnd:/tab: targeting model, but frame and limit receive no explanation at all in either place.

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?

Specific verb and resource: 'Execute JavaScript in the page or a frame and return the result.' It is immediately distinguishable from sibling DOM readers like ie_get and ie_html, and states the return behavior up front.

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?

It gives real guidance on the execution mode split (session driver vs hwnd:/tab: over COM) and the resulting scripting constraints, but never says when to reach for ie_js instead of ie_get, ie_html, or ie_fill. Usage is implied by capability rather than stated as a selection rule.

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