Skip to main content
Glama

zen_js

Execute JavaScript code in the active browser tab to manipulate page content or retrieve data. Optionally target a specific tab by ID.

Instructions

Execute JavaScript in the current page context.

Args: code: JavaScript code to run (e.g. "document.title" or "document.querySelectorAll('a').length") tab_id: Optional tab to target. Defaults to active tab.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
tab_idNo
Behavior2/5

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

No annotations are provided, leaving the description to convey behavioral traits. It states that the tool 'execute JavaScript' but does not disclose that it can mutate page state, trigger events, or run with page privileges. The lack of warnings about side effects or error handling 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 extremely concise: two sentences clarify purpose and parameters with an example. No unnecessary words. Front-loaded with the main action. This is an efficient and clear presentation.

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 lack of output schema and the complexity of JavaScript execution, the description omits critical details: what the tool returns (the result of the code?), how errors are reported, whether async code is supported, or if there are restrictions (e.g., no access to certain globals). The agent has insufficient information to use the tool reliably.

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

Parameters2/5

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

Schema description coverage is 0%. The description only provides a single example for the 'code' parameter and restates the default for 'tab_id' from the schema. It does not explain expected code format (e.g., synchronous vs async), return value handling, or error behavior, leaving the agent without crucial usage details.

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?

Description clearly states the tool executes JavaScript in the current page context, which is a specific and well-defined action. The verb 'execute' and resource 'current page' are precise. No sibling tool offers arbitrary JS execution, so it is easily distinguished.

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 an example but offers no guidance on when to use this tool versus siblings like zen_click or zen_fill. It does not mention scenarios where direct JS execution is preferable over higher-level actions, nor does it warn about potential side effects.

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/JayQuan-McCleary/ZenLink-MCP'

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