Skip to main content
Glama

browser_evaluate

Destructive

Evaluate JavaScript expressions on a page or specific element to extract data, manipulate content, or test behavior directly in the browser context.

Instructions

Evaluate JavaScript expression on page or element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetNoExact target element reference from the page snapshot, or a unique element selector
elementNoHuman-readable element description used to obtain permission to interact with the element
filenameNoFilename to save the result to. If not provided, result is returned as text.
functionYes() => { /* code */ } or (element) => { /* code */ } when element is provided
Behavior2/5

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

Annotations already carry destructiveHint=true and readOnlyHint=false, so the description doesn't contradict them. However, the description adds no additional behavioral context—it doesn't warn that the evaluation can modify the page, require element targeting, or return results in a specific format. With annotations present, the bar is lower, but this desc provides almost no value beyond the bare statement.

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?

A single, front-loaded sentence with zero waste. It immediately conveys the core purpose without extraneous detail. Perfectly concise for what it intends to say.

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

Completeness2/5

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

For a code execution tool, the description is severely under-specified. It doesn't explain return value behavior (no output schema), how to reference elements, when results are saved to file vs returned as text, or any security/side-effect warnings. Siblings like browser_run_code_unsafe hint at a risk distinction, but this desc doesn't provide enough for an agent to use it correctly without opening the schema and guessing.

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 description coverage is 100%, so the schema documents all four parameters (target, element, filename, function). The description adds no extra meaning beyond the schema; it doesn't clarify relationships between parameters or give examples. Baseline 3 is appropriate because the schema handles the heavy lifting.

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?

The description clearly states the action (evaluate) and the target (JavaScript expression on page or element). It is specific enough to distinguish from navigate/click tools, though it doesn't explicitly differentiate from the sibling browser_run_code_unsafe. The verb-resource pairing is unambiguous.

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?

The description gives no guidance on when to use this tool versus alternatives. It doesn't mention when to prefer browser_run_code_unsafe, nor does it mention prerequisites like needing a snapshot or user permission. Agents are left to infer usage purely from the schema.

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/erlanov2023e/playwright-mcp-render-mt8x2ig6'

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