Skip to main content
Glama
Savvy-Tech-Sphere

usable-browser-agent-free

browser_eval

Run JavaScript code in the live browser page and return the result, enabling custom actions not covered by dedicated tools.

Instructions

Run JavaScript in the page and return the result. Disabled under hardened mode, which is the default; the operator enables it by setting UBA_STRICT_SECRETS=0 in the server environment. On Firefox the code runs in the content-script sandbox; on Chrome it runs in the page's own realm, where the page can observe it and its CSP applies. Use only when no dedicated tool fits.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesJS body; use `return value;` to return data.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden. It discloses that the tool is disabled by default and how to enable it, and details environment-specific execution differences (Firefox sandbox vs Chrome page realm with CSP and observability). This goes well beyond a simple 'run JS' and prepares the agent for side effects.

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 moderately long but every sentence carries essential information: purpose, operational constraints, environment differences, and usage guidance. It is well-structured and front-loaded with the core action, though it could be trimmed slightly without losing value.

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 generic eval tool with no output schema, the description covers the key operational and environmental aspects. It explains how to return data and notes platform differences. Minor omissions like error handling or return format are acceptable given the tool's flexibility.

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?

The input schema already documents the 'code' parameter with 100% coverage. The description adds a valuable usage hint: 'use `return value;` to return data,' which clarifies how to extract results. This supplements the schema without redundancy, earning a 4.

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 states a specific verb and resource: 'Run JavaScript in the page and return the result.' It also distinguishes itself from the many sibling tools by explicitly saying 'Use only when no dedicated tool fits,' making it clear this is a fallback for custom scripting not covered by other tools.

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

Usage Guidelines5/5

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

Provides explicit when-to-use guidance: 'Use only when no dedicated tool fits.' It also explains the operational prerequisite (disabled under hardened mode, enabled via UBA_STRICT_SECRETS=0), which is critical for an agent to know before attempting invocation. This is clear and actionable.

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