Skip to main content
Glama
WhiteNightShadow

camoufox-reverse-mcp

evaluate_js

Execute a JavaScript expression in the page context and receive a cleaned, serializable result. Automatically handles promises, special values, and serialization errors with fallback and warnings.

Instructions

Execute an arbitrary JavaScript expression in the page context and return the result.

v1.0.1 fix: correctly handles undefined/null/void/Symbol return values without triggering JSON.parse crashes.

Return value is aggressively cleaned (strips BOM, fixes lone surrogates, trims whitespace, auto-parses JSON strings). If direct evaluate fails with serialization error, automatically falls back to evaluate_handle.

Args: expression: JavaScript expression. Must be a single expression, not top-level var/let/const/function declarations (Playwright limitation). Wrap in IIFE if needed: (() => { var x = 1; return x; })() await_promise: If True, awaits Promise results (default True).

Returns: dict with keys: value - cleaned value (parsed JSON if applicable) value_raw - raw string before cleaning (only when cleaning applied) type - "primitive" | "json" | "handle_fallback" | "error" warnings - list of applied cleanups, if any hint - (error only) friendly fix suggestion or None

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes
await_promiseNo
Behavior4/5

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

Despite no annotations, the description details behavior: automatic fallback to evaluate_handle on serialization error, aggressive cleaning of return values (BOM, lone surrogates, whitespace, JSON auto-parse), and structured return dict with keys. This provides good transparency beyond the schema.

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?

The description is well-structured with a clear purpose statement, version note, behavior details, argument list, and return format. It is front-loaded but slightly lengthy; each sentence adds value, though minor redundancy exists (e.g., version note in both description and returns).

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?

Given the tool's complexity (arbitrary JS execution), lack of output schema, and no annotations, the description is remarkably complete. It covers edge cases (fallback, cleaning), return structure, and hints for errors, providing an agent with sufficient context to invoke and interpret results correctly.

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

Parameters5/5

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

Schema coverage is 0%, but the description fully explains both parameters: expression must be a single expression (not declarations) with IIFE workaround, and await_promise defaults to true. This adds critical meaning beyond the schema's simple type definitions.

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 the tool executes arbitrary JavaScript expressions in the page context, using specific verb+resource. It distinguishes itself from siblings like 'scripts' and 'hook_function' by focusing on arbitrary evaluation, not script management or hooking.

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?

While it provides constraints (single expression, no declarations, IIFE if needed) and notes on await_promise, it does not offer guidance on when to use this tool over siblings like 'scripts' or 'hook_function'. No explicit when-to-use or alternatives are mentioned.

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

Install Server

Other Tools

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/WhiteNightShadow/camoufox-reverse-mcp'

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