Skip to main content
Glama
sumyapp
by sumyapp

browser_evaluate

Execute custom JavaScript on a page or specific element to extract data, automate interactions, and validate behavior during browser testing.

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
sessionIdYesThe session ID to use for this operation
Behavior2/5

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

There are no annotations, so the description carries the full burden of behavioral disclosure. It merely says 'Evaluate JavaScript expression' without mentioning potential side effects, safety implications, or whether the page can be modified. The wording 'evaluate' sounds read-only, but arbitrary JS execution can have side effects, and the description does not clarify this risk.

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 a single concise sentence with no wasted words. It is front-loaded with the action. However, it is so brief that it omits important context that would be relevant for a code execution tool, though that omission is more a completeness issue than a conciseness problem.

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 tool that executes arbitrary JavaScript, the description is severely under-specified. With no annotations and no output schema, it should explain security considerations, return format, and when to use it versus browser_run_code_unsafe. None of this is present, making the tool difficult to invoke safely and correctly.

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?

The input schema provides 100% parameter description coverage, so the schema already documents each parameter. The description adds minimal value by mentioning 'on page or element', which hints at the optional target/element parameters, but does not elaborate on syntax or expected behavior beyond what the schema already states. Baseline 3 is appropriate given high schema coverage.

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 'Evaluate JavaScript expression on page or element' uses a clear verb and resource, indicating the tool executes JS in the browser context. It is not a tautology and gives basic scope, but it does not differentiate from the sibling tool 'browser_run_code_unsafe', which also executes code.

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?

No guidance is provided on when to use this tool versus alternatives like browser_run_code_unsafe or other interaction tools. The description lacks context on appropriate scenarios, prerequisites, or exclusions, leaving the agent to infer usage from the name and schema alone.

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/sumyapp/playwright-parallel-mcp'

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