Skip to main content
Glama

evaluate

Run JavaScript in the browser page for calculations, style mutations, shadow DOM access, in-page fetch, or app-specific side effects. Use explicit returns or ternaries to obtain results.

Instructions

Run JavaScript in the page. Good uses: computation, style mutations (.style.X = ..., classList), shadow-root traversal, in-page fetch(), app-specific side effects no dedicated tool covers. Scope is shared between calls; top-level const/let/class are wrapped in an IIFE. If/else blocks may return undefined — use a ternary or an explicit return.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYesJavaScript code to execute in the page context
await_promiseNoWhether to await Promise results

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv2.10.5
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / additionalProperties
      Removed value: -false
  2. First observedv2.7.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden, and it delivers: it warns that scope is shared between calls, top-level declarations are wrapped in an IIFE, and if/else blocks may return undefined, recommending ternaries or explicit returns. This is meaningful execution behavior an agent needs to predict results. It omits error handling and return-format details, but the provided traps are valuable.

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 compact sentences carry high signal: the primary purpose, a curated list of good uses, and the critical behavioral caveats. Every sentence adds value, and the most important facts are front-loaded. It is appropriately concise for the complexity involved.

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 JS-evaluation tool with two simple parameters and no output schema, the description covers purpose, usage scope, and key execution quirks. Missing are default return behavior and error semantics, but the given detail is enough for most agent decisions. The tool is not so complex that every nuance needs explanation.

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 description coverage is 100%: both 'expression' and 'await_promise' have descriptive schema text. The description adds no parameter-level information, so it earns the baseline score of 3. No gaps in parameter understanding remain because the schema already explains them.

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 begins with a clear verb and resource: 'Run JavaScript in the page.' It then enumerates specific good-use categories (computation, style mutations, shadow-root traversal, in-page fetch, app-specific side effects) that distinguish it from sibling tools like click, type, and dom_snapshot. It also signals it is the fallback when 'no dedicated tool covers' a case, which helps an agent choose it correctly.

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?

The description gives explicit use cases and implies dedicated tools take precedence ('no dedicated tool covers'). It does not explicitly list which sibling to use instead for common actions, but the provided good uses create a clear boundary. The guidance is usable and context-rich, though it could be stronger by naming alternatives.

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

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/Silbercue/public-browser'

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