Skip to main content
Glama
funkyfunc

browser-dvr-mcp

by funkyfunc

evaluate_in_context

Execute arbitrary JavaScript in any browser frame, including iframes and shadow DOM, to inspect app state, styles, or trigger custom logic.

Instructions

Execute arbitrary JavaScript in any frame context, including out-of-process iframes (OOPIFs) and shadow DOM hosts. Uses Target.setAutoAttach to discover all execution contexts automatically.

USE CASES: • Inspect React/Vue/Angular state: evaluate_in_context({ expression: "document.querySelector('#app').vue.$data" }) • Read computed styles: evaluate_in_context({ expression: "getComputedStyle(document.body).backgroundColor" }) • Trigger custom app logic: evaluate_in_context({ expression: "window.myApp.reset()" }) • Execute in an iframe: evaluate_in_context({ expression: "document.title", frameIndex: 1 })

IMPORTANT: This is the tool that replaces framework-specific macros. Instead of using a React-specific sniffer, write the exact JS introspection you need. This keeps the MCP server unopinionated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timeoutMsNoEvaluation timeout in milliseconds (default: 5000)
expressionNoJavaScript expression to evaluate. The result is returned as JSON. Omit to list available frames.
frameIndexNoFrame index to evaluate in (0 = main frame). Call with no args to list available frames.
Behavior3/5

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

No annotations provided, so description bears full burden. It discloses execution in frames and use of Target.setAutoAttach, but does not mention potential destructive side effects or security implications of executing arbitrary JS. Lacks a caution about mutating page state.

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?

Well-structured with sections (description, use cases, important note). Examples are helpful. Could be slightly more concise, but information density is good.

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

Completeness3/5

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

No output schema, but description mentions 'result is returned as JSON'. Does not explain error handling (e.g., syntax errors, timeouts). With 3 params and full schema coverage, description covers usage but lacks edge-case behavior details.

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% with descriptions. Description adds value by explaining that omitting expression lists available frames and that frameIndex with no args also lists frames. This clarifies usage beyond schema.

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?

Description clearly states 'Execute arbitrary JavaScript in any frame context' and provides specific use cases (inspecting state, reading styles, triggering app logic, executing in iframes). Distinguishes itself from sibling tools by being the general-purpose JS evaluation tool.

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

Usage Guidelines4/5

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

Explicitly lists use cases and when to use (e.g., inspecting React state, reading computed styles). Implicitly contrasts with framework-specific macros. Could improve by stating when not to use (e.g., for simple queries other tools might suffice).

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/funkyfunc/browser-dvr-mcp'

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