Skip to main content
Glama
hooplus1ce

DrissionPage-MCP

by hooplus1ce

执行 JS

run_js

Execute JavaScript in a browser tab and retrieve serializable results. Use as an expression or function body to return data.

Instructions

在标签页中执行 JavaScript 并返回结果(可 JSON 序列化的部分)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesJS 代码;as_expr=False 时作为函数体执行(可用 return),True 时作为表达式求值
tab_idNo标签页 id,省略时用最新标签页
as_exprNo是否按表达式求值

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations indicate readOnlyHint=false, so the agent knows this may have side effects. The description adds the behavioral detail that only JSON-serializable results are returned, which is useful. However, it does not disclose potential side effects beyond that, such as whether the script can navigate the page or modify state. Given the annotation already flags non-read-only, the description adds a bit of value but leaves room for more context.

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 a single, front-loaded sentence that immediately states the action and result. No redundant phrasing or filler. It earns its place by being short and direct.

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?

The tool has an output schema, so return format is covered elsewhere. The schema fully documents all parameters. The description explains the core purpose and the JSON-serializable constraint. The main missing piece is usage guidance (e.g., when to prefer this over other tools), but for a simple execution tool with annotations and schema, the description is reasonably complete.

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%, so the parameters (script, tab_id, as_expr) are fully documented in the schema. The description does not add additional meaning beyond what the schema provides. It only clarifies the return value, not the parameters, so a baseline of 3 is appropriate.

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 in a tab and returns the JSON-serializable portion of the result. This is a specific verb (execute) + resource (JS in tab) + outcome (return result). It distinguishes itself from all sibling tools since none other directly executes arbitrary JS.

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 no guidance on when to use this tool versus alternatives. It does not mention any preconditions (e.g., needing a live tab), nor does it suggest when custom JS is preferable over higher-level element actions like element_click. The as_expr parameter is explained in the schema, but not in terms of use-case selection.

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