Skip to main content
Glama
codeiva11
by codeiva11

execute_js

Run JavaScript code in the live browser page, with support for async functions, return value capture, and iframe targeting. Automate complex scenarios that require direct page context execution.

Instructions

Execute custom JavaScript in the page context with async support, return value capture, and iframe targeting.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesJavaScript code to execute in the page context
asyncNoWrap code in an async function
iframeNoExecute inside a specific iframe (0 = main frame, 1+ = iframe by index)
timeoutNo
returnValueNoReturn the result of the expression
waitForIframeNoWait for the iframe to finish loading before executing
iframeSelectorNoExecute inside iframe matched by CSS selector

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv3.2.13

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden of disclosing behavior. It does mention several key traits: async execution, return value capture, and iframe targeting. However, it is silent on side effects of arbitrary JS execution, error handling, page-state impact, or limitations, which is a notable gap for a high-privilege execution tool.

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?

The description is a single, efficient sentence with no filler. It front-loads the core purpose and then lists the key capabilities compactly, making it easy for an agent to parse quickly.

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

Completeness2/5

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

For a complex, potentially side-effect-heavy tool with 7 parameters and no annotations or output schema, the description is too sparse. It does not explain how return values are serialized, how iframe selection behaves in edge cases, what happens on timeout or JS errors, or what side effects may occur in the page.

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 description coverage is high (86%), so the schema already documents most parameters. The description adds context around code, async, return value, and iframe targeting, but it does not clarify timeout, waitForIframe behavior, or the relationship between iframe and iframeSelector beyond what the schema provides.

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 clearly states a specific action ('Execute'), a resource ('custom JavaScript in the page context'), and includes differentiators: async support, return value capture, and iframe targeting. This makes it immediately distinct from sibling tools like click, type, or navigate.

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

Usage Guidelines2/5

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

The description provides no explicit guidance on when to use this tool versus alternatives, nor does it mention exclusions or conditions where built-in browser actions should be preferred. Usage is only implicitly inferable from the phrase 'custom JavaScript'.

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

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/codeiva11/Real-Browser-Mcp'

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