Skip to main content
Glama

content_execute_script

Executes JavaScript code in a specified Firefox tab using a profile and tab ID, enabling page inspection or automation; optional per-origin approval may be required.

Instructions

Execute JavaScript code in a tab

An optional extension setting requires user approval per tab/origin. Each approval prompt expires after 60 seconds; queued tabs wait in turn.

profile_id is required: obtain it from profiles_list. All object IDs are local to that profile; never reuse them in another profile.

Input Schema

NameRequiredDescriptionDefault
codeYesJavaScript code to execute
tab_idYesID of the tab to execute script in
profile_idYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.6.0

TDQS

A3.8/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 and does well: it discloses that an extension setting may require per-tab/origin user approval, that prompts expire after 60 seconds, and that queued tabs execute in turn. These are real behavioral traits (blocking, timing, user interaction) an agent needs. It stops short of saying whether execution errors surface as tool errors or in the output.

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?

Front-loaded with the action, then supporting constraints in short lines; there is no filler. The phrase 'an optional extension setting' is slightly vague about which setting, but the overall structure is efficient and scannable.

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?

An output schema exists, so return values need not be explained, and the three required parameters plus approval/queueing behavior are covered. Given the tool executes arbitrary code, a note on error semantics or side effects would have closed the remaining gap.

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 coverage is 67% with profile_id undocumented in the schema; the description compensates by stating profile_id is required, how to obtain it, and that all object IDs are scoped to that profile and must not be reused elsewhere. That adds meaning beyond the schema for the one gap, though code and tab_id get no further detail.

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 first line gives a specific verb+resource (execute JavaScript code in a tab) that clearly separates it from data-reading siblings like content_get_text or content_get_html. It does not explicitly name content_execute_predefined as the alternate, so the distinction from that closest sibling is left implicit.

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?

The description establishes prerequisites (profile_id required, obtain via profiles_list, IDs are profile-local) which is useful routing context. However it never states when to choose this over content_execute_predefined or content_load_file, so the when-to-use decision is only implied.

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