Skip to main content
Glama
zhuhroscar-tech

safari-mcp-server

safari_js

Run custom JavaScript inside a live Safari tab and retrieve the string-coerced output. Use it to manipulate page content or extract data directly from the browser session.

Instructions

Evaluate arbitrary JavaScript in a Safari tab's page context and return the string-coerced result. Requires Safari's Develop menu > 'Allow JavaScript from Apple Events' to be enabled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabNo
codeYes
windowNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden for behavioral disclosure. It does disclose that execution happens in the page context and that results are string-coerced, and it mentions the required Develop menu setting. However, it does not describe side effects, error behavior, tab/window targeting semantics, or that arbitrary JS can modify the page.

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?

Two sentences with no filler. The core behavior is front-loaded, and the prerequisite is stated separately and clearly. Every sentence earns its place.

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?

The description covers what and prerequisite but omits important operational context for a code-execution tool: target tab/window selection, return-value edge cases, and side-effect expectations. With no output schema and no annotations, this leaves meaningful gaps for an agent deciding how to invoke the tool safely.

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%, yet the description provides no parameter-level meaning beyond the word 'JavaScript' hinting at 'code'. The optional 'tab' and 'window' parameters are not explained, so the agent cannot determine how target selection works or what null defaults mean.

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 uses a specific verb ('Evaluate') and resource ('arbitrary JavaScript in a Safari tab's page context'), and clearly distinguishes this from siblings like safari_click, safari_fill, and safari_read. It also states the output behavior ('return the string-coerced result'), leaving no ambiguity about the tool's core function.

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?

No guidance is given about when to prefer safari_js over sibling tools, nor are alternatives mentioned. The 'arbitrary JavaScript' wording implies broad use, but there is no explicit when-to-use or when-not-to-use context, leaving the agent to infer the decision.

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