Skip to main content
Glama

evaluate_script

Evaluate JavaScript expressions in WeChat MiniApp debugging sessions to inspect runtime behavior and analyze code execution during development.

Instructions

Evaluates a JavaScript expression in the current context. If execution is paused, it automatically evaluates in the paused call frame context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes
return_by_valueNo
await_promiseNo
context_idNo
frame_indexNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the paused execution context, which is useful, but doesn't cover critical aspects like whether this is a read-only or mutating operation, potential side effects, authentication needs, rate limits, or error handling. For a tool that evaluates JavaScript, this lack of safety and behavioral details is a significant gap.

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 highly concise and front-loaded, with two clear sentences that directly state the tool's function and a key behavioral nuance. Every word earns its place, with no wasted text or redundancy, making it easy for an AI agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of evaluating JavaScript (which can involve side effects, security risks, and debugging contexts), no annotations, 0% schema description coverage, and 5 parameters, the description is incomplete. While an output schema exists (which might cover return values), the description lacks crucial context about behavioral traits, parameter meanings, and usage boundaries, making it inadequate for safe and effective tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning none of the 5 parameters are documented in the schema. The description provides no information about parameters beyond the required 'expression' implied in the purpose. It doesn't explain what 'return_by_value', 'await_promise', 'context_id', or 'frame_index' mean or how they affect evaluation, failing to compensate for the schema's lack of descriptions.

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 clearly states the tool's purpose: 'Evaluates a JavaScript expression in the current context.' It specifies the verb ('evaluates') and resource ('JavaScript expression'), and adds important context about paused execution. However, it doesn't explicitly differentiate from sibling tools like 'search_in_sources' or 'get_script_source', which keeps it from a perfect score.

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

Usage Guidelines2/5

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

The description provides some usage context with 'If execution is paused, it automatically evaluates in the paused call frame context,' which hints at when this behavior applies. However, it lacks explicit guidance on when to use this tool versus alternatives (e.g., for debugging vs. general evaluation), and doesn't mention prerequisites or exclusions, leaving gaps for an AI agent.

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/zhizhuodemao/miniapp-cdp-mcp'

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