Skip to main content
Glama

Upload Files

upload_files

Set files on an input[type=file] using paths within the artifact directory, so Playwright browser workflows can test or automate file uploads.

Instructions

Set files on an input[type=file]. File paths must be inside the artifact directory.

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>",
      "paths": "<paths>"
    },
    "name": "upload_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathsYes
pageIdNoPage id. Defaults to the active page.
selectorYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations supplied, the description carries the full burden, and it does disclose a real behavioral constraint: file paths must live inside the artifact directory, which is non-obvious and prevents failed calls. It remains silent on whether upload completion is awaited, how multiple paths are handled, or what happens on invalid paths, leaving meaningful gaps for a mutation-style browser action.

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 short sentences, front-loaded with the verb and target, followed by the hard constraint. No filler, no repetition of the title, and nothing that could be cut without losing information.

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

Completeness3/5

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

For a 3-parameter action with no annotations and no output schema, the definition covers the essentials but not the edges. An agent still cannot tell whether the call blocks until upload finishes, what the success signal is, or how to validate the selector.

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 coverage is only 33%, so the description must compensate. It adds genuine meaning for `paths` via the artifact-directory restriction, which is absent from the schema. But `selector` is never explained (e.g., that it must resolve to a file input), and the interaction of multiple paths with a single input is left unspecified.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and target: 'Set files on an input[type=file]', which makes the operation and its target element type unambiguous. It does not name sibling alternatives (fill, click, set_checked) to explicitly route the agent, but the file-input scoping does most of the disambiguation on its own.

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

Usage Guidelines3/5

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

Usage is implied by 'input[type=file]' — the agent can infer this is not for text fields or checkboxes. However, there is no explicit when-to-use vs. when-not guidance, no prerequisites (e.g., element must be attached/visible), and no mention of alternatives for other input types.

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