Skip to main content
Glama
seleniumbase

SeleniumBase MCP

Official

evaluate

Execute arbitrary JavaScript in the current page and retrieve its return value for browser automation and scraping.

Instructions

Evaluate a JavaScript expression in the page context and return the result. Equivalent to execute_script. This method can run any arbitrary JavaScript on any site, so take any necessary precautions to prevent AI harnesses from running scripts that you don't want them to run.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes
Behavior4/5

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

With no annotations, the description carries the full burden, and it does add meaningful behavioral context: it warns that arbitrary JavaScript can be run on any site and that precautions are necessary. This signals the tool's potentially destructive or side-effectful nature beyond what the name and schema convey. It could also mention result serialization or async behavior, but the risk disclosure is substantial.

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?

Three sentences, each earning its place: the first defines the core behavior, the second disambiguates the alias, and the third supplies a necessary safety warning. The description is appropriately sized and front-loaded with the primary purpose.

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

Completeness4/5

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

For a one-parameter tool with no output schema, the description covers what the tool does, what the parameter represents, that it returns a result, and the key safety consideration. The only meaningful gap is the lack of usage-routing guidance relative to the large set of sibling tools, but the core calling contract is otherwise complete.

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 description coverage is 0%, so the description must compensate; it does by clarifying that 'expression' is a JavaScript expression evaluated in the page context and that a result is returned. This is meaningful for the single required parameter, even though it lacks examples or advanced details.

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 action: evaluate a JavaScript expression in the page context and return the result. It is distinct from all sibling tools, which are focused on clicks, typing, navigation, waiting, and assertions, and the explicit 'Equivalent to execute_script' further anchors the tool's identity.

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 about when to use evaluate versus the many dedicated sibling tools, nor any exclusions such as 'prefer specific click/type/assert tools when possible.' The equivalence to execute_script is mentioned, but execute_script is not among the sibling tools, so it does not help an agent choose between alternatives.

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/seleniumbase/SeleniumBase'

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