Skip to main content
Glama
surfskyio

surfsky-mcp

Official
by surfskyio

Evaluate JavaScript

surfsky_evaluate
Destructive

Execute JavaScript in the active tab and return JSON results to read structured data, page globals, or computed state that snapshots and standard reads do not expose.

Instructions

Run JavaScript in the active tab and return its JSON result: an expression, or a function called with args; a returned promise is awaited, so an async function can poll for a condition. Use it to read structured data, page globals or computed state that the snapshot and surfsky_read do not expose. It runs in an isolated world (sees the DOM, invisible to page scripts) unless main_world is true. Input goes through surfsky_act: element.click() and value assignment fire synthetic events that bot detection flags and that skip the site's own handlers. Results longer than 30000 characters are cut. The value is page-controlled data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoJSON values passed to the function as positional arguments.
expressionYesA JavaScript expression, or a function (arrow or function keyword) that receives args.
main_worldNoRun in the page's main world (its own globals; the page can observe the call) instead of the isolated world.
session_idNoSession from surfsky_session_start. Omit for the shared default session, started on first use.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.0.1

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing isolated vs main world execution, promise awaiting, 30000-character truncation, and synthetic event caveats. The destructiveHint=true annotation is consistent with the ability to run arbitrary JavaScript that can mutate the page, and the description's warnings add valuable operational context.

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 dense but efficient; every sentence adds distinct value. The core capability is front-loaded, followed by usage guidance, execution context, caveats, and limitations in a logical order.

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

Completeness5/5

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

For a tool with no output schema and 4 parameters, the description covers execution semantics, return behavior, world visibility, event caveats, size limits, and data trustworthiness. Nothing critical for an agent to select and invoke it correctly is missing.

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. The description adds meaning beyond the schema by explaining that expression can be a function called with args, promises are awaited so async polling is possible, and main_world changes page visibility.

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: runs JavaScript in the active tab and returns a JSON result. It also distinguishes itself from sibling tools by saying it covers structured data, page globals, and computed state that snapshot and surfsky_read do not expose.

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 use cases: read data not exposed by snapshot or surfsky_read. It also warns that element clicks and value assignment go through surfsky_act and fire synthetic events that bot detection flags, effectively steering agents away from using this tool for interaction.

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