Skip to main content
Glama

Run code in a browser session

execute_browser_session
Destructive

Execute JavaScript in an existing account-owned browser page, optionally navigating first. Code can click, type, submit forms or change a website: review the exact code and URL. Omit confirm to inspect the session and proposed parameters without running code. Execution is charged separately from session creation: read its current price with get_endpoint web/sessions/execute. Requires confirm=true, an idempotency key and max_credits. Use call_endpoint web/sessions/get for status. This controls a hosted browser, not a local shell.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYesEndpoint parameters from get_endpoint, using string values. Omit dry_run: confirm controls preview versus execution.
confirmNoOmit or false for a free preview. Only boolean true authorizes execution.
session_idYes
max_creditsNoMaximum credits this action may reserve. Required when confirming job/session creation or browser-code execution. Does not change a previous charge or guarantee a refund.
idempotency_keyNoRequired for execution (or supply Idempotency-Key header). Reuse the same key after a lost response; use a new key for a new action. Previews do not consume it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already flag destructive/openWorld, but the description adds what those costs mean in practice: code can click, type, submit forms or alter a website, so the exact code and URL should be reviewed; execution is billed separately from session creation; confirm=true, an idempotency key and max_credits are all mandatory; and it is a hosted browser, not a local shell. This is well beyond the annotation bar.

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?

Front-loaded with the action and the safety warning before cost and prerequisite details. Every sentence carries information, though the pricing-pointer and status-pointer sentences make it denser than strictly necessary.

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?

For a destructive, nested-object, no-output-schema tool, the description covers cost, authorization prerequisites, preview semantics and a status-check sibling. The only real gap is what execution returns, which the description leaves unaddressed despite there being no output schema to fall back on.

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 80%, so the schema already documents confirm, max_credits, idempotency_key and params. The description reinforces that params come from get_endpoint and are strings, and that confirm gates preview vs run, but adds little syntactic or semantic detail the schema lacks. Baseline 3 fits.

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?

Opens with a precise verb+resource+scope: 'Execute JavaScript in an existing account-owned browser page, optionally navigating first.' It distinguishes itself from create_browser_session ('existing'), from generic code execution ('not a local shell'), and names the sibling used for pre-run inspection.

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

Usage Guidelines5/5

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

Gives explicit when-to-use branching: omit/false confirm for a free preview, confirm=true to actually run, and points to call_endpoint web/sessions/get for status and get_endpoint web/sessions/execute for pricing. Alternatives and prerequisites are spelled out rather than inferred.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources