Skip to main content
Glama

safari_upload_file

Upload a file directly to an HTML file input via JavaScript DataTransfer—no file dialog or UI interaction. Optionally verify image previews before publishing.

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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "selector": "<selector>",
      "filePath": "<filePath>"
    },
    "name": "safari_upload_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
whyNoOptional short purpose of this step, shown to the user in the cursor's status pill (e.g. 'to save the settings'). The page can read it: never put passwords, codes, card numbers or other private data in it.
receiptNoOmit it: Daylight has no tab receipts and refuses a call that passes one
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.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/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 so: it discloses that no UI interaction occurs, that an open dialog gets closed, the API-level mechanism (DataTransfer), the false-negative reporting on 'verified 0 files' with custom handlers, and the ghost-pickup failure mode on Google Business Profile. These are non-obvious runtime behaviors an agent could not infer from the schema.

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 mechanism and the primary caveat (don't pre-click) are front-loaded, followed by failure-mode notes in descending order of importance. Every sentence conveys a distinct operational fact; the all-caps emphasis is a stylistic choice but each emphasized clause carries a real warning.

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 file-upload tool with no annotations and no output schema, it covers the full decision space: how it works, what not to do first, and how to confirm success when the reported result is unreliable. The only gap is that it doesn't describe the actual return payload beyond the 'verified 0 files' string, leaving the shape of a successful response implicit.

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 100%, so baseline is 3; the description adds real meaning beyond it by explaining when to reach for verifyPreview (images in a composer, sites that flip to 'attached' while ingesting nothing) and implying forceNative's escalation role. The why and receipt parameters are left entirely to 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?

States a precise verb+resource (upload a file to an <input type='file'> element) and the exact mechanism (JavaScript DataTransfer) with explicit scope exclusion ('NO file dialog, NO UI interaction'). This distinguishes it from generic interaction tools like safari_click or safari_fill without the agent needing to open any schema.

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

Usage Guidelines5/5

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

Gives an explicit when-not ('Do NOT click the file input before calling this tool — just provide the selector and file path'), a documented edge case (closes an already-open dialog), and routes verification to safari_snapshot. It also conditions the two optional flags: verifyPreview for images in a composer, forceNative for sites known to reject synthetic uploads.

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

Deploy Server

Other Tools