Skip to main content
Glama

Attach a file to an upload field

qa_upload

Attach a file to a page's file input—even a hidden one behind a styled dropzone or a native picker button—using a hostile test fixture, local path, or base64 content; batch multiple fields in one call.

Instructions

Put a file into an — including the hidden ones behind a styled dropzone, which a click can never reach. Three ways to choose what goes in: fixture for a hostile edge-case file (the upload counterpart of naughty strings — empty, oversize, wrong-type, corrupt, unicode name, unsanitised SVG…), path for a file on this machine, or content as base64. Pass content as base64 to attach a file YOU generated (a PDF fixture, a malformed CSV, an oversized image); omit it and Qiksy attaches a neutral test file matched to the field's accept. A content script has no filesystem access and the OS file picker is a modal an agent must never open, so bytes over this bridge are the only way a file from outside the browser gets in. AND WHERE THERE IS NO FILE INPUT AT ALL — a button that calls the native picker straight away, as YouTube Studio's audio-language dialog does — name that button with field and the file is handed to the picker it opens, exactly as a person choosing it would. The reply says via when that route was used, and it says so only when the page actually took the file. Delivery fires both paths uploaders use — assigning input.files + change, and a synthetic drop on the nearest dropzone — because react-dropzone-style components listen only for the second. SEVERAL FIELDS IN ONE CALL: pass files — an array of the same arguments — and they are attached in order, one round trip for the whole step instead of one per file.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "qa_upload"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNoA ref from qa_snapshot
nameNoFile name, e.g. 'report.pdf'
pathNoAbsolute path to a file ON THIS MACHINE — the server reads and encodes it for you. Use this instead of `content` for anything bigger than a few hundred bytes.
fieldNoThe upload CONTROL's accessible name — "Premises photos", "Company logo". Prefer this over a ref: an upload field is usually a hidden input behind a styled dropzone, and a step with two dropzones has two of them. Without a field (and without a ref or selector) the file lands in the page's FIRST file input, which is how two photos ended up attached to the logo.
filesNoAttach several files in ONE call — each entry takes the same arguments as a single upload. Use this when a step has more than one upload field.
tabIdNoTarget tab (from qa_tabs); omit for the active tab
contentNoBase64 file content, for a file you are holding in memory. Prefer `path`.
fixtureNoA HOSTILE fixture built in the page, so it costs nothing to send: empty (0 bytes) · oversize (12MB) · wrong-type (a PNG named .pdf — is content checked or only the extension?) · corrupt (truncated PNG) · long-name (255 chars) · unicode-name (RTL + emoji + CJK) · svg-script (is an uploaded SVG sanitised?) · double-ext (invoice.pdf.exe — does the UI show the whole name?). The answer comes back as `asks`.
mimeTypeNoMIME type, e.g. 'application/pdf'
selectorNoCSS selector of the file input or its dropzone; omit to use the page's first file input

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.86.2

TDQS

A4.4/5.0
Behavior4/5

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

No annotations exist, so the description carries the full behavioral burden and does a lot of it: it discloses that delivery fires both `input.files`+change and a synthetic drop (react-dropzone only listens for the second), that `via` appears in the reply only when the page truly accepted the file, that hidden inputs are unreachable by click, and that fixtures are built in-page so they cost nothing to send. What it omits is failure semantics — what happens when `field` matches nothing or the page rejects the file — and whether errors throw or return a status.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core statement is front-loaded, but the body is dense and rhetorically charged — an all-caps clause, em-dash asides, and base64/`content` guidance repeated in adjacent sentences ('Pass `content` as base64' after already saying '`content` as base64'). Several sentences carry real information, but a tighter version would read faster and lose nothing.

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 10-parameter tool with no output schema and no annotations, the description covers the modes, the bypass case, the multi-file path, the delivery mechanics, and even the `via`/`asks` fields in the reply. It stops short of describing error or no-match behavior, which an agent would want before relying on it in a long flow.

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, but the description adds real meaning beyond the schema: it explains why `field` beats `ref` (two dropzones, two hidden inputs) and what each `fixture` enum value is probing for (empty, oversize, wrong-type, corrupt, unicode name, unsanitised SVG, double-extension). It also clarifies the `files` array is the same argument set applied in order.

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 first sentence gives a specific verb and resource — put a file into an <input type=file> — and immediately sharpens it with the case a sibling like qa_click cannot handle: the hidden input behind a styled dropzone. An agent can distinguish this from clicking or filling without opening 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?

Explicit routing rules for every mode: `fixture` for hostile edge-case files, `path` for something on disk, `content` for bytes the agent itself generated. It also states a negative constraint (the OS picker is a modal an agent must never open), names the no-file-input fallback via `field`, and tells the agent to use `files` rather than repeating calls. That is when-to-use, when-not-to, and alternatives in one place.

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