Skip to main content
Glama
soulxyz

BrowserPilot

by soulxyz

browser_evaluate

Execute JavaScript in the current page context to retrieve or manipulate data, returning the result to support web automation and testing.

Instructions

Execute JavaScript in page context. Supports both function form "() => expression" and direct expression "document.title". Returns the evaluation result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
functionYesJavaScript code to execute. Can be a function like "() => document.title" or a direct expression like "document.title". For complex logic, use function form like "() => { const x = 1; return x + 1; }"

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.4/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It mentions that execution happens 'in page context' and that the result is returned, but it fails to disclose potential side effects (e.g., page mutation), support for async expressions, error behavior, or result serialization limits. For arbitrary JS execution, this is a significant gap.

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?

The description is two sentences with no redundant filler. It front-loads the core purpose, then immediately provides the two accepted input forms. Every sentence adds value and there is no wasted text.

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?

Although the tool has only one parameter and no output schema, the description does not explain important execution details: whether promises are awaited, how complex return values are serialized, whether the code can modify the page, or how errors are surfaced. For a JS evaluation tool with no annotations, this leaves an agent uncertain about critical behavior.

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 schema description already covers the 'function' parameter thoroughly, including examples of both function and expression forms, giving 100% schema coverage. The tool description repeats that same information and adds little beyond the schema, so the baseline of 3 is appropriate.

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 uses a specific verb and resource: 'Execute JavaScript in page context.' It clearly distinguishes itself from all sibling browser tools, which handle navigation, clicks, screenshots, etc., so an agent can immediately tell this is the tool for running JS in the page.

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

Usage Guidelines3/5

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

The description implies that this tool is for executing JavaScript, but it does not explicitly state when to use it over alternatives like browser_snapshot or browser_console_messages. It provides no when-not-to-use guidance or prerequisites, relying on the reader to infer the use case.

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