Skip to main content
Glama

browser_file_upload

Destructive

Upload files to web forms during browser automation. Specify file paths to simulate user file selection in automated web interactions.

Instructions

Upload one or multiple files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathsNoThe absolute paths to the files to upload. Can be single file or multiple files. If omitted, file chooser is cancelled.

Implementation Reference

  • The handler function that executes the browser_file_upload tool. It validates the input parameters, retrieves the current tab, submits the file paths to the file chooser, and returns a code snippet indicating the internal file selection.
    handle: async (context, params) => {
      const validatedParams = uploadFileSchema.parse(params);
      const tab = context.currentTab();
      return await tab.runAndWait(async () => {
        await tab.submitFileChooser(validatedParams.paths);
        const code = [
          `// <internal code to chose files ${validatedParams.paths.join(', ')}`,
        ];
        return { code };
      }, {
        captureSnapshot,
        noClearFileChooser: true,
      });
    },
  • Defines the Zod schema for input validation (paths array) and the tool schema object including the name 'browser_file_upload', description, and converted JSON schema.
    const uploadFileSchema = z.object({
      paths: z.array(z.string()).describe('The absolute paths to the files to upload. Can be a single file or multiple files.'),
    });
    
    const uploadFile: ToolFactory = captureSnapshot => ({
      capability: 'files',
      schema: {
        name: 'browser_file_upload',
        description: 'Upload one or multiple files',
        inputSchema: zodToJsonSchema(uploadFileSchema),
      },
  • Registers the browser_file_upload tool by including the uploadFile factory in the exported array of tools.
    export default (captureSnapshot: boolean) => [
      uploadFile(captureSnapshot),
    ];
Behavior3/5

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

Annotations indicate this is a destructive, non-read-only, open-world operation, which the description doesn't contradict. It adds minimal behavioral context by implying file selection (via 'file chooser' in schema), but doesn't detail side effects like UI interactions, permissions, or error handling beyond what annotations provide.

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?

The description is a single, efficient sentence with zero waste. It's front-loaded with the core action ('upload files') and includes a useful detail ('one or multiple'), making it appropriately sized for its purpose.

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?

Given the tool's complexity (destructive file upload), lack of output schema, and rich annotations, the description is minimally adequate. It states what the tool does but lacks details on outcomes, error cases, or integration with browser context, leaving gaps for an agent to infer usage.

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 the schema fully documents the 'paths' parameter. The description adds no additional meaning about parameters beyond what's in the schema, such as file format constraints or upload behavior specifics, meeting the baseline for high coverage.

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 clearly states the verb ('upload') and resource ('files'), specifying it can handle 'one or multiple files'. It distinguishes from most browser siblings that interact with page elements rather than file operations, though it doesn't explicitly differentiate from potential file-related tools not present in the sibling list.

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an active browser session), exclusions, or how it relates to other browser tools like form filling or dialog handling that might involve file uploads.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/markbustamante77/mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server