Skip to main content
Glama

page.upload_files

Attach local files to an HTML file input element on the active page, selecting the field by CSS selector, XPath, snapshot ref, or visible text.

Instructions

Set files on a file input.

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": {
      "files": "<files>"
    },
    "name": "page.upload_files"
  }
}

Input Schema

NameRequiredDescriptionDefault
nthNoZero-based index when the locator matches several elements.
refNoSnapshot ref (eNN) from page.snapshot.
textNoVisible text of the element.
filesYesAbsolute paths on the daemon host.
xpathNoXPath expression.
frame_idNoFrame to search within; see page.list_frames.
selectorNoCSS selector; pierces shadow DOM.
target_idNoTarget handle (tgt_*). Omit for the active page.
browser_idNoBrowser handle (br_*). Omit to use the only running browser, or auto-launch one.
backend_node_idNoCDP backendNodeId, e.g. from inspector.pick.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=false and openWorldHint=true, so mutation and external-world reach are covered. The description adds nothing beyond that: it does not say whether a prior file selection is replaced or appended, whether change events fire as a result, or what happens if the locator matches multiple or zero elements.

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?

A single front-loaded sentence with no filler or redundancy. It is efficient, though its brevity borders on under-specification that the other dimensions already capture.

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

Completeness2/5

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

For a ten-parameter mutating tool with no output schema, the description is too thin. It never explains that one of nine locator parameters is needed to find the input, nor what the tool returns or how failures on a non-file input manifest.

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%, so all ten parameters, including the required files array with its "absolute paths on the daemon host" note, are already documented. The description adds no meaning beyond the schema, which is the expected baseline here rather than a deficiency.

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?

"Set files on a file input" names a specific verb and resource, and the phrase "file input" makes the target element type clear enough to distinguish it from page.click or page.select_option. It stops short of saying it performs an upload/attaches files programmatically, but an agent can still tell what the tool does.

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

Usage Guidelines2/5

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

There is no guidance on when to use this instead of page.select_option or page.click, no prerequisite such as obtaining a ref via page.snapshot, and no note that the element must be an <input type=file>. The agent must infer both the trigger condition and the setup steps.

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