Skip to main content
Glama
Himangguo
by Himangguo

evaluate_js

Execute JavaScript expressions in the page context to inspect or modify page state. Returns results while blocking access to sensitive APIs like cookies, localStorage, and fetch.

Instructions

在页面上下文中执行 JavaScript 表达式,返回执行结果。禁止访问 cookie/localStorage/fetch 等敏感 API。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes要执行的 JavaScript 表达式
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses that execution happens in page context, returns the result, and prohibits access to sensitive APIs like cookie/localStorage/fetch. This is valuable safety context, though it does not mention potential side effects, promise handling, or error behavior.

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 two sentences: the first states the core action, the second states a critical restriction. It is front-loaded, concise, and every sentence serves a purpose with no unnecessary information.

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 simple one-parameter tool with no output schema or annotations, the description covers the action, the return value, and a key constraint. It omits details about return formatting, async scenarios, or side effects, but these are less critical given the tool's straightforward nature. It is reasonably complete for its complexity.

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%, with the only parameter 'expression' described as 'the JavaScript expression to execute.' The description does not add any extra syntax, format, or usage details beyond what the schema already provides, so it meets the baseline without enhancing parameter understanding.

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 clearly states the tool executes JavaScript expressions in the page context and returns the result. This specific verb+resource combination distinguishes it from sibling tools that read DOM metrics or inspect tabs, which do not execute arbitrary code.

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 context is clear: use this tool when you need to run JavaScript in the page. However, it does not explicitly mention alternatives or exclusions relative to sibling tools, though the prohibition on sensitive APIs provides a form of 'when not to do X' guidance.

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

Install Server

Other Tools

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/Himangguo/chrome-devtools-mcp'

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