Skip to main content
Glama

上传文件

browser_upload_file
Destructive

Uploads local files into a page's file input using an element ref and absolute paths, with a 20MB total size limit.

Instructions

Upload local file(s) into a element by ref. Accepts absolute local paths; total size capped at 20MB. Fire-and-forget is enough — the change event fires for the page.

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

Input Schema

NameRequiredDescriptionDefault
refYesElement ref of the file input
pathsYesAbsolute local file path(s)
tabIdNoTab id (default: active tab)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.15.0

TDQS

A3.7/5.0
Behavior4/5

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

The annotations already declare destructive, non-idempotent, open-world behavior, so the bar is lower. The description still adds real operational facts beyond them: a 20MB total size cap, the requirement for absolute paths, and the fact that the change event fires so no follow-up verification step is needed.

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?

Three short, front-loaded sentences with the target element stated first, followed by constraints and then the event behavior. Nothing is padded, though the parenthetical size cap could be folded more tightly into the constraint sentence.

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 3-parameter tool with full schema coverage and no output schema, this covers the essentials: target, payload constraints, and post-action behavior. The main remaining gap is failure behavior — what happens when the cap is exceeded or a path is invalid — and there is no hint about why the operation is flagged destructive.

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%, and the schema already states that paths are absolute local paths and that tabId defaults to the active tab. The description only restates 'by ref' and 'absolute local paths,' adding no format or constraint detail beyond the schema, so the 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 gives a specific verb plus resource: upload local file(s) into an <input type=file> element identified by ref. That is enough to tell it apart from generic interaction siblings like browser_click or browser_fill_form, though it never names an alternative explicitly.

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 the mention of an <input type=file> target and by 'fire-and-forget is enough — the change event fires for the page,' which tells the agent not to wait or re-verify. There is no explicit when-to-use versus when-not-to-use guidance and no mention of what to do if the element is not a file input.

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