Skip to main content
Glama

browser_execute_script

Run JavaScript code directly in the current page to extract data or manipulate the browser, returning the result.

Instructions

Execute JavaScript code in the context of the current page. Returns the result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesJavaScript expression to evaluate (runs in page context)
Behavior2/5

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

With no annotations, the description bears full responsibility for behavioral disclosure. It mentions execution and result but fails to disclose potential side effects like page mutation, security implications, or error handling, which are critical for a powerful script execution tool.

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 concise with two clear sentences, no unnecessary words. It is front-loaded with the action and context, but could be slightly expanded without losing conciseness.

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

Completeness3/5

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

Given the single parameter and no output schema, the description covers the basic purpose and result. However, it lacks important context about error behavior, return type, and potential side effects, making it only minimally complete for a tool of this power.

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 coverage is 100% and the schema already describes the 'code' parameter in detail. The description adds slight value by stating that the result is returned, but does not enrich parameter understanding beyond the schema.

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 action ('Execute JavaScript code') and the context ('in the context of the current page'), with the added return value. This uniquely identifies the tool among sibling browser tools, all of which perform distinct non-JS actions.

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

Usage Guidelines3/5

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

No explicit when-to-use or when-not-to-use guidance is provided. The usage is implied by the unique capability of executing JS, but the description does not mention alternatives or caution against misuse.

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

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/Agent360dk/browser-mcp'

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