Skip to main content
Glama

safari_upload_file

Uploads a local file directly into a web page's file input using a CSS selector and absolute path, without opening a file dialog or clicking the input.

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

NameRequiredDescriptionDefault
receiptNoTab receipt from safari_new_tab — pins this call to that tab (survives reconnects/subagents)
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. Changed1 schema field changedv2.22.13
    • addedInput schema / properties / receipt
      Added value: +{
      +  "description": "Tab receipt from safari_new_tab — pins this call to that tab (survives reconnects/subagents)",
      +  "type": "string"
      +}
  2. 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"
      +}
  3. Addedv2.11.6
  4. Removedv2.11.3
  5. Addedv2.10.9
  6. Removedv2.10.8
  7. Addedv2.10.5
  8. Removedv2.10.4
  9. First observed

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 load and does it well: it discloses that it closes an existing dialog, that 'verified 0 files' can be a false negative on custom handlers, that synthetic pickup can be a 'ghost' on some sites (Google Business Profile), and how it escalates. These are exactly the behavioral traits an agent cannot infer from structured fields.

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 critical rule (do not click the input first) and the no-dialog mechanism are front-loaded, and the image/verifyPreview caveat follows logically. It is dense and long-ish, but nearly every clause carries actionable information; minor trimming is possible.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation-style browser tool with no output schema and no annotations, the description covers the return-signal caveat ('verified 0 files'), the visual verification path (safari_snapshot), escalation behavior, and preconditions. Nothing needed to call it correctly is missing.

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 the baseline is 3. The description adds genuine value for verifyPreview by explaining the ghost-ingestion failure mode and its consequence (post publishes with no image), going beyond the schema's own wording. forceNative and receipt are left to the schema, so not a 5.

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 (upload a file) and the exact mechanism (JavaScript DataTransfer into a <input type='file'>), which distinguishes it from near-neighbors like safari_paste_image or safari_fill. An agent knows exactly what this does without opening the 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 explicit when/when-not rules: do NOT click the file input first, use verifyPreview:true for images in a composer/editor, and forceNative for sites known to reject synthetic uploads. It even handles the pre-condition that a file dialog may already be open. The only omission is naming a sibling fallback, but the operational guidance is unusually complete.

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