Skip to main content
Glama

execute_js

Run JavaScript in the current page and get the returned value. Redacts secrets unless disabled; requires confirmation to prevent unsafe execution.

Instructions

Run JavaScript in the page and return its result. Use return for a value; secrets in output are redacted unless redact=false. DANGER: requires confirm=true

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
redactNo
tab_idNo
confirmNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden of disclosure. It reveals that secrets are redacted unless redact=false, and highlights the danger and mandatory confirm=true. This is meaningful behavioral context beyond the raw schema, though it does not cover all side effects of arbitrary JS execution.

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 compact and front-loaded with the core action and result. Every phrase delivers useful information—return syntax, redaction default, and the danger warning—with no filler or repetition.

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?

For a powerful, potentially destructive tool with 4 parameters, no output schema, and 0% schema coverage, the description gives critical warnings but misses important context. It does not explain how tab_id is used, what the result format looks like, or how errors are surfaced, leaving an agent partially under-informed when invoking it.

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 0%, so the description must compensate. It adds meaning for code (use return to get a value), redact (secret redaction toggle), and confirm (needs to be true). However, tab_id is completely unaddressed, leaving one parameter semantic gap.

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 a specific action ('Run JavaScript in the page') and a specific outcome ('return its result'). It is easily distinguishable from most siblings, though it does not explicitly differentiate itself from similar tools like inject_script or send_to_injected.

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?

Provides practical usage tips: 'Use `return` for a value', redaction behavior, and the confirm requirement. However, it does not explicitly state when to prefer this tool over alternatives or when not to use it, leaving selection among sibling execution tools somewhat implied.

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