Skip to main content
Glama

browser_evaluate

Execute JavaScript expressions or arrow functions in a page and return JSON results, enabling bulk item extraction; optionally run in an Electron app's main process.

Instructions

Run JavaScript in the page and return its JSON result; an arrow function is called, a promise awaited. Use it to extract many items at once. In an Electron app (navigera mcp --electron), main: true runs it in the app's main process, a function getting the electron module.

Input Schema

NameRequiredDescriptionDefault
mainNoElectron only: run in the app's main process
expressionYesA JavaScript expression or arrow function

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.1

TDQS

A4.1/5.0
Behavior4/5

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

The annotations declare readOnlyHint=false and openWorldHint=true, and the description is consistent with that by describing arbitrary JavaScript execution. It adds useful behavioral detail beyond annotations: arrow functions are called, promises are awaited, and Electron main-process execution is supported via main:true.

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 front-loaded with the core action and return behavior, then adds the primary use case and Electron-specific detail. Every sentence contributes useful information without repetition.

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?

With no output schema, the description appropriately states that the JSON result is returned. It covers async behavior and Electron main-process execution, though it could say more about error behavior or JSON-serializability constraints.

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?

Schema description coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema by explaining that expression may be an arrow function, that promises are awaited, and that main:true runs in Electron's main process with access to the electron module.

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 states a specific verb and resource: "Run JavaScript in the page and return its JSON result." It also gives a use case, "extract many items at once," which helps distinguish it from snapshot-style siblings, though it does not name an alternative tool explicitly.

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 provides clear usage context with "Use it to extract many items at once," indicating when this tool is appropriate. It does not state when not to use it or name a specific alternative among the many browser siblings.

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