Skip to main content
Glama
wxhzhwxhzh

DrissionPageMCP

by wxhzhwxhzh

run_js

Execute JavaScript code in the current browser tab and retrieve the result. Use it to interact with page elements: find elements, read their information, or perform actions.

Instructions

在当前标签页中运行JavaScript代码并返回执行结果 查找网页元素,获取元素信息,操作网页元素优先使用这个方法

Args: js_code (str): 要执行的JavaScript代码

Returns: Any: JavaScript代码执行结果

Note: 想要获取执行的js代码的返回值,可以在js_code中使用return语句。 想要获取异步函数的返回值,可以参考下面代码 return (async (url) => { const response = await fetch(url); const data = await response.json();
return data; })("https://www.baidu.com/");

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
js_codeYes
Behavior4/5

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

With no annotations, the description carries the transparency burden. It explains how to get return values via 'return' and provides an async IIFE pattern for async code, going beyond mere execution. It does not disclose potential side effects, but the core behavior is clearly stated.

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?

The description is well-structured with Description, Args, Returns, and Note sections. The example is concise and valuable, making every sentence earn its place. Slightly long but not wasteful.

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?

Although there is no output schema, the description provides enough to use the tool effectively, including return value semantics and async handling. It could mention error handling or execution context restrictions, but it is complete for common use cases.

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 0%, but the description's Notes section adds critical semantics beyond the schema: use 'return' for return values and an async IIFE for promises. This compensates well for the bare schema parameter.

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 'Run JavaScript code in the current tab and return the execution result', with a specific verb and resource. It also differentiates from siblings by advising to prefer this method for finding, getting info, and operating on web elements.

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 description provides explicit guidance to prefer this method for element-related tasks, which distinguishes it from specialized sibling tools. However, it does not mention when not to use it or name specific alternatives.

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/wxhzhwxhzh/DrissionPageMCP'

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