Skip to main content
Glama
Santhosh-p653

Scrapling MCP Server

Run JavaScript

browser_evaluate
Destructive

Executes JavaScript expressions or functions on the current page, awaits promises, and returns JSON-compatible results for extracting dynamic data and checking page state.

Instructions

Run JavaScript on the current page, await promises, and return JSON text without a snapshot. Return JSON-compatible values; null/undefined become null. Script effects are not undone on failure. Cancellation stops waiting, but may not stop the script.

Input Schema

NameRequiredDescriptionDefault
argNoJSON object passed to the function; use properties for scalar or array values.
expressionYesJavaScript expression or function to invoke.
session_idYesID from `browser_open`; call `browser_fetch` first.
isolated_contextNoFalse accesses the page's own JS variables; True uses a separate context with the same DOM.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false and openWorldHint=true, but the description adds two pieces of genuine context the agent could not infer: script effects are not undone on failure, and cancellation may not stop the script. That is exactly the operational caveat a caller needs before invoking an irreversible page mutation.

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?

Four short sentences, front-loaded with the core action, then return-value normalization, then two failure caveats. No filler; the only mild cost is that 'without a snapshot' is left unexpanded.

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?

There is no output schema, and the description compensates by explaining the return shape (JSON text, null/undefined coerced to null). Combined with the failure and cancellation caveats, the agent has enough to invoke it safely; only error-signaling specifics are absent.

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 100%, so each parameter (including isolated_context and arg) is already documented in the schema; the description adds no parameter-level guidance such as when to disable isolated_context or how expression vs arg interact. Baseline 3 applies when the schema carries the load.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Run JavaScript on the current page') plus scope details: awaits promises and returns JSON text without a snapshot, which implicitly distinguishes it from browser_screenshot and browser_extract. It never names a sibling, so differentiation is inferential rather than explicit.

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?

'without a snapshot' hints that this is the no-screenshot path, but there is no explicit statement of when to choose browser_evaluate over browser_extract, browser_actions, or browser_fetch, nor any prerequisite sequencing beyond the session_id note in the schema.

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