Skip to main content
Glama

safari_upload_file

Upload files directly to any file input on a page without UI interaction. Supply a CSS selector and file path, and the tool injects the file via JavaScript DataTransfer, optionally verifying a preview appears.

Instructions

Upload a file to a element via JavaScript DataTransfer — NO file dialog, NO UI interaction. IMPORTANT: Do NOT click the file input before calling this tool — just provide the selector and file path. If a file dialog is already open, this tool will close it first. NOTE: 'verified 0 files' may appear even on success if the site uses a custom upload handler — check visually with safari_snapshot. For an IMAGE going into a composer/editor that should show a thumbnail, pass verifyPreview:true — some sites (Google Business Profile) accept the file handle and flip their UI to 'attached' while ingesting nothing, and the post then publishes with no image.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filePathYesAbsolute path to the file to upload
selectorYesCSS selector of the file input
forceNativeNoSkip synthetic injection and go straight to the real OS file dialog (isTrusted). Needs an unlocked screen and briefly focuses Safari. Use when the site is known to reject synthetic uploads.
verifyPreviewNoRequire a visible preview (blob:/data: image) to appear; if none does, the synthetic pickup was a ghost and this escalates to a real OS file dialog. Use for images going into a composer.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed2 schema fields changedv2.16.3
    • addedInput schema / properties / forceNative
      Added value: +{
      +  "description": "Skip synthetic injection and go straight to the real OS file dialog (isTrusted). Needs an unlocked screen and briefly focuses Safari. Use when the site is known to reject synthetic uploads.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / verifyPreview
      Added value: +{
      +  "description": "Require a visible preview (blob:/data: image) to appear; if none does, the synthetic pickup was a ghost and this escalates to a real OS file dialog. Use for images going into a composer.",
      +  "type": "boolean"
      +}
  2. Addedv2.11.6
  3. Removedv2.11.3
  4. Addedv2.10.9
  5. Removedv2.10.8
  6. Addedv2.10.5
  7. Removedv2.10.4
  8. First observed

TDQS

A4.5/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full disclosure burden — and it is exceptionally candid. It discloses that the tool will close an open file dialog first, that 'verified 0 files' may appear even on success with custom upload handlers, and that some sites (Google Business Profile) accept the file handle but ingest nothing, causing the post to publish with no image. It also reveals the verifyPreview escalation behavior to a real OS dialog. This is model behavioral disclosure.

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 long (~120 words) but every element earns its place — the don't-click warning, the verification caveat, and the concrete Google Business Profile bug are all operationally essential. The key directive is front-loaded, with edge cases following. Dense but not bloated; the length is justified by the tool's complexity.

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?

For a complex synthetic-injection tool with no output schema and full schema coverage, the description is nearly complete: it covers the action, prerequisites, failure modes, verification behavior, and escalation path. The only minor gap is that the exact return format is not specified beyond the 'verified 0 files' note, but with no output schema declared, the description is more than sufficient for correct invocation.

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 description coverage is 100%, so the baseline is 3. The description adds genuine value beyond the schema: the Google Business Profile failure case explains why verifyPreview exists, and the forceNative path's need for 'an unlocked screen and briefly focuses Safari' is stated in the description. This elevates the parameter guidance above the schema baseline.

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?

States a specific verb, resource, and mechanism: 'Upload a file to a <input type='file'> element via JavaScript DataTransfer.' The 'NO file dialog, NO UI interaction' framing explicitly differentiates it from any native/UI-driven interaction, and the synthetic-vs-native mechanism distinguishes it from related siblings like safari_native_type or safari_paste_image. No ambiguity about what this tool does.

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

Usage Guidelines4/5

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

Gives explicit how-to-use directives: 'Do NOT click the file input before calling this tool — just provide the selector and file path,' plus when to pass verifyPreview (images into a composer) and when to use forceNative ('Use when the site is known to reject synthetic uploads'). It does not explicitly name alternative tools for exclusion cases, but the conditional guidance for the flag parameters is concrete and actionable.

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/achiya-automation/safari-mcp'

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