Skip to main content
Glama

browser_evaluate

Run policy-gated read-only JavaScript in a browser tab when standard extraction methods fail. Use as a fallback for required facts.

Instructions

Run policy-gated read-only JavaScript in a tab only when browser_extract or browser_observe cannot return the required fact. For visible page text, labels, controls, or a region owned by aria-controls, use browser_extract instead; for computed styles, colors, fonts, sizes, icons or backgrounds, browser_extract read=design (the page, or one component with target_ref) or read=inspect (one element's box and styles).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argNoOptional argument passed to the function.
tab_idYes
functionYesJS function/expression (aliases: expression, code, js, script).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description says the JavaScript runs 'policy-gated' and 'read-only,' which are meaningful behavioral disclosures: the agent knows it cannot mutate state and that some policy restricts execution. However, it doesn't detail what the policy prohibits, how failures appear, or whether the return is serialized, so some gaps remain for an unannotated tool.

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 two dense sentences that front-load the core purpose and then immediately provide alternative routing. It is well-structured and every clause adds routing information, though slightly long for a single-breath read.

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 3-parameter, no-output-schema, no-annotation tool, the description covers purpose, constraints, and alternatives well. It does not explain what the function returns or how results are structured, which is acceptable given no output schema, but it also doesn't mention error handling or serialization limits for read-only evaluation.

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 67%. The description does not mention the 'arg', 'tab_id', or 'function' parameters, leaving those to the schema. The schema already documents 'arg' and 'function' partially; the missing third parameter description is not compensated in the description. Baseline 3 for moderate coverage with no extra parameter guidance.

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 delivers a precise verb ('Run policy-gated read-only JavaScript'), the resource ('in a tab'), and an explicit scope constraint ('only when browser_extract or browser_observe cannot return the required fact'). It clearly distinguishes itself from sibling tools by naming them.

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?

The description provides explicit when-to-use (only when other tools fail) and when-not-to-use, with concrete alternative routing: 'use browser_extract instead' for text/labels/controls, and 'browser_extract read=design or read=inspect' for styles/visual properties. No inference is left to the agent.

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