Skip to main content
Glama
mcp-browser-dev-tools

mcp-browser-dev-tools

by Hinaser

upload_file

Attaches local files from permitted directories to a browser file input or file chooser button, then fires change events so automated upload flows can proceed.

Instructions

Set files on a file input (or its label, or an element holding one; on Chromium also a button that opens a file chooser) and fire change events. Files must be in the working or temp directory or MCP_BROWSER_UPLOAD_DIRS. Returns changes.

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_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathsYesAbsolute file paths; [] clears the input.
selectorYesLocator: ref=e3, CSS, text=…, role=button[name="…"], name=…, or a >> b
sessionIdNo
timeoutMsNoms to retry while the element is missing (default 2000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.4

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden, and it does disclose meaningful behavior: change events are fired, uploads are sandboxed to the working/temp directory or MCP_BROWSER_UPLOAD_DIRS, and there is Chromium-specific handling. It omits whether existing files are replaced or appended and what an error looks like, which keeps it below a 5.

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?

The core action is front-loaded in the first clause, followed by the target variations and then the path restriction. The parenthetical is dense and stacks three cases, but every piece carries information an agent needs. Minor tightening would earn a 5.

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 4-parameter mutation tool with no annotations and no output schema, the definition covers the target forms, the sandbox rule, side effects, and a rough return signal ("Returns changes"). The return statement is thin and replacement semantics are unstated, which are the remaining gaps.

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 75%, so the baseline is 3, but the description adds a real semantic constraint the schema lacks: paths must resolve inside the working/temp directory or the configured upload dirs. That is more than restating parameter types. sessionId and timeoutMs are left entirely to the schema.

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 description states a specific verb+resource ("Set files on a file input") and immediately broadens the target set to a label, a containing element, or on Chromium a file-chooser button. It also names the side effect ("fire change events"), which no sibling like click or type does. An agent can distinguish this from click/type/select without opening the schema.

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?

Usage is clear from context: use this when the target is a file input or something wrapping one, with an explicit browser-specific note for Chromium buttons. It also states an operational precondition for where files may live. It stops short of naming an alternative or a when-not condition, so it is strong but not exhaustive.

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