Skip to main content
Glama

safari_upload_file

Upload files directly to web forms using JavaScript DataTransfer without opening file dialogs or interacting with UI elements. Specify a CSS selector and file path to automate file uploads in Safari browser automation.

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector of the file input
filePathYesAbsolute path to the file to upload
Behavior5/5

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

With no annotations provided, the description carries full disclosure burden and excels by revealing non-obvious behaviors: the automatic closing of existing dialogs and the critical quirk that ''verified 0 files' may appear even on success' with explanation (custom upload handlers). It transparently explains the JavaScript injection mechanism vs. native dialog interaction.

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?

Four sentences with zero waste: sentence 1 defines the mechanism, sentence 2 gives the critical 'do not click' warning, sentence 3 discloses the dialog-closing side effect, and sentence 4 provides troubleshooting context. Information is front-loaded with the core action, and formatting (caps for IMPORTANT/NOTE) enhances scannability without adding length.

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 2-parameter tool with no annotations and no output schema, the description comprehensively covers the upload mechanism, prerequisites, side effects, and verification method via sibling tool. Minor gap: it describes what success looks like negatively ('verified 0 files' case) but doesn't explicitly characterize the positive success indicator or return structure, though this is partially mitigated by the safari_snapshot reference.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% (selector: 'CSS selector of the file input', filePath: 'Absolute path to the file to upload'), establishing a baseline of 3. The description references these parameters ('provide the selector and file path') but adds no additional semantic details, examples, or format specifications beyond what the schema already documents.

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 clearly states the specific action (Upload a file), target resource (<input type='file'> element), and mechanism (JavaScript DataTransfer). It effectively distinguishes from UI-based upload methods by emphasizing 'NO file dialog, NO UI interaction,' making the tool's unique headless capability obvious among the many safari_* interaction tools.

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?

Provides explicit preconditions and warnings: 'Do NOT click the file input before calling this tool' with the correct alternative action ('just provide the selector and file path'). It also mentions side effects ('If a file dialog is already open, this tool will close it first') and references sibling tool safari_snapshot for verification, creating a complete usage protocol.

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