Skip to main content
Glama

Evaluate

browser_evaluate

Execute JavaScript in a page context to return values and extract text or attributes for read-only inspection and automation.

Instructions

在页面里执行一段 JS 并返回结果(只读用得多:取文本、取属性)。默认 ego 引擎。

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": {
      "expression": "<expression>"
    },
    "name": "browser_evaluate"
  }
}

Input Schema

NameRequiredDescriptionDefault
engineNo浏览器引擎:ego(默认,真实浏览器 + 登录态)/ edge(Playwright/Edge,需另装 playwright)ego
expressionYes在页面上下文里求值的表达式或函数体

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It does disclose the default engine (ego) and frames typical use as read-only, but it never warns that this executes arbitrary JS, so writes, mutations, or side effects on page state are possible, and it gives no hints on error behavior when the expression fails.

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?

Three short clauses, front-loaded with the action and followed by the typical use case. The trailing note about the default engine is largely redundant with the schema default and could be dropped.

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 2-parameter tool with no annotations and no output schema, the definition is minimal but workable. It never states what the returned result looks like (a serialized value, a DOM node, a string) or how errors surface, which matters for an evaluation tool whose return shape is unpredictable.

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 100%, so both parameters (expression, engine) are already documented, including the enum descriptions. The description only repeats the default-engine fact that the schema's default already establishes, adding essentially no new meaning.

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: execute a JS snippet in the page and return the result, plus the typical read-only uses (getting text, getting attributes). This lets an agent distinguish this tool from page-navigation or clicking tools, though it never names a concrete sibling for contrast.

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

Usage Guidelines3/5

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

"只读用得多:取文本、取属性" implies when the tool is appropriate, a light form of usage guidance. There is no explicit when-not guidance, no mention of when snapshot or other extraction siblings are preferable, and no prerequisites stated.

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