Skip to main content
Glama
Browser Controller

Browser Controller

by compnew2006

browser_evaluate

Run JavaScript in a browser tab to retrieve values or perform custom interactions, returning expression results when standard click/type actions are insufficient.

Instructions

Run JavaScript in the tab; expressions return values, statements use return. Top-level await works. Prefer click/type; browser_safety applies the site's rule.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "tabId": "<tabId>",
      "expression": "<expression>"
    },
    "name": "browser_evaluate"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabIdYes
timeoutNo
expressionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.5.0

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It usefully discloses expression-vs-statement semantics and top-level await support, but omits important behavior such as sandboxing, side effects, permission requirements, and error handling for an arbitrary-JS execution tool.

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 extremely short and front-loaded, with each clause adding distinct value. No unnecessary wording is present.

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

Completeness3/5

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

For a high-risk JavaScript-evaluation tool with no annotations and no output schema, the description covers invocation basics and safety routing. It remains incomplete on security/sandbox behavior, side effects, return handling, and parameter details.

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 coverage is 0%, so the description must compensate for the three parameters. It adds meaningful semantics for the expression parameter, but leaves tabId and timeout unexplained, especially the 1s–30s timeout bound.

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 specific action: run JavaScript in the tab. It distinguishes itself from interaction tools by advising preference for click/type, though it does not fully contrast with all siblings.

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

Usage Guidelines4/5

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

It gives explicit guidance to prefer click/type and notes that browser_safety applies the site's rule. It lacks a clear statement of when not to use the tool or when browser_evaluate is required.

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