Skip to main content
Glama

Attach a file to a file input

browser_upload_file

Attach one or more local files to a file input selected by CSS selector, using native absolute paths so Firefox can read and upload them.

Instructions

Attach one or more local files to the file input matching a CSS selector (privileged not required). IMPORTANT (measured on Windows): paths must be NATIVE (D:dir ile.txt); a file:///D:/... URL is rejected with "File error: Unrecognized path". The file is read by Firefox itself, so it must exist and be readable.

Input Schema

NameRequiredDescriptionDefault
filesYesNative absolute paths of the files to attach
contextNoTab context id (default: the active tab)
selectorYesCSS selector of the file input

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

With only readOnlyHint=false available, the description carries the burden well: it discloses a non-obvious platform constraint (paths must be NATIVE on Windows), quotes the exact rejection error for file:/// URLs, and explains the underlying reason (Firefox itself reads the file, so it must exist and be readable). This is precisely the kind of operational knowledge an agent cannot derive from the schema or annotations.

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, front-loaded with the action and immediately followed by the highest-risk constraint flagged with "IMPORTANT". No filler; every clause either states the operation or prevents a known failure.

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 mutation tool with no output schema, the description covers what to do, what will fail, and why. It does not say what happens after the attach (whether change events fire, whether a form submit or network request follows, or what the call returns), which an agent may need to know before chaining further steps.

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 schema already documents all three parameters; the baseline would be 3. The description adds meaning on top, specifically the path-format rule and failure mode for the files parameter beyond the schema's terse "Native absolute paths of the files to attach", justifying a notch above 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?

"Attach one or more local files to the file input matching a CSS selector" gives a specific verb (attach), a specific resource (local files), and the exact targeting mechanism (CSS selector). It is clearly distinguishable from browser_click/browser_type siblings, which operate on generic elements rather than file inputs.

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?

The description makes the use case clear enough (attaching local files to a file input) and even notes "privileged not required", which tells the agent no special add-on permission is needed. However, it offers no explicit when-not guidance or named alternative for cases where the input is not a real file input (e.g., drag/drop via browser_drag_html5 or click-based pickers), so it stops short of full routing guidance.

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