Skip to main content
Glama
Pagewright (browser-mcp)

Pagewright (browser-mcp)

by zamansheikh

browser_upload_file

Attach local files to a file input by setting its files from absolute paths, using an element ref or CSS selector in the active or specified browser tab.

Instructions

Set local files on an .

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

Input Schema

NameRequiredDescriptionDefault
refNoElement ref from browser_snapshot, e.g. "e12". Preferred over selector.
pathsYesAbsolute file paths.
tabIdNoTab to act on. Defaults to the tab last opened/selected by an agent, else the active tab.
selectorNoCSS selector, "text=Sign in" (visible text), or "xpath=//button". Searches open shadow roots too.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations supplied, the description carries the full behavioral burden and says almost nothing: it does not state whether change/input events are dispatched, whether it waits for the upload, whether the target element must already exist, or what error surfaces for a non-file input. Only the bare mutation intent is conveyed.

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?

One short sentence with no filler and the key resource ('<input type=file>') front and center. Its brevity is efficient rather than padded, though the terseness borders on under-specification.

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 page-mutating tool with no annotations and no output schema, the description leaves out prerequisites (snapshot-derived ref) and post-conditions (whether the upload completes or events fire). The rich schema compensates for the parameter side, but the behavioral side remains thin.

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 four parameters (ref, paths, tabId, selector) are already documented in the schema, including the ref-over-selector preference. The description adds no extra meaning such as path restrictions or how multiple paths map to a multi-file input; baseline 3 applies.

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?

The description states a specific verb and target ('Set local files on an <input type=file>'), which is concrete enough to separate it from text-entry siblings like browser_type or browser_click. It does not explicitly contrast with any sibling, so it stops short of a 5.

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 when-to-use guidance: nothing says a snapshot must be taken first to obtain a 'ref', nor when to prefer 'ref' over 'selector' (the preference is only stated inside the schema). It also gives no alternative path for cases where the page has no file input.

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