Skip to main content
Glama

browser_save_file

Read-onlyIdempotent

Save a file from the page into the workspace's files and get its file_id (use it with messages.send attachment_file_ids or any files.* tool). The bytes move server-side, never through your context, so size is not a problem. source is one of: 'expression' — expression is JS that evaluates (promises are awaited) to a Blob/File, ArrayBuffer, typed array, Response, 'data:'/'blob:' URL or string, e.g. a recording kept in the page: 'window.__recordedBlob' or 'fetch("/export").then(r => r.blob())'; 'url' — url is fetched with this browser session's cookies (headers optional); 'download' — a download the page starts: pass ref to click the button that starts it, or omit ref to take the newest download the page already started (or wait for the next, up to timeout_ms). Optional filename and mime_type override what the page or server reports. Returns {file_id, name, mime, size}.

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": {
      "page_id": "<page_id>",
      "source": "<source>"
    },
    "name": "browser_save_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNo
urlNo
frameNo
sourceYes
headersNo
page_idYes
filenameNo
mime_typeNo
expressionNo
timeout_msNo
in_workspaceNoRun this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly, non-destructive and idempotent, and the description adds real context beyond them: bytes move server-side so payload size is irrelevant, promises are awaited in 'expression', downloads may block up to `timeout_ms`, and filename/mime_type override page-reported values. Minor tension exists between persisting a new workspace file and readOnlyHint=true, but the operation does not mutate page or existing state, so this is not a contradiction.

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?

Front-loaded with purpose, return shape and the key behavioral fact (bytes never touch context) before the mode-by-mode detail. It is a single dense paragraph — long, but every clause carries operational information; sectioning by source mode would have made it slightly easier to scan.

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

Completeness5/5

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

Given 11 parameters and no output schema, the description discloses the return shape {file_id, name, mime, size}, the mode semantics, waiting behavior, and the attachment follow-up path. An agent can call this correctly without further exploration.

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 description coverage is only 9% and there are 11 parameters, so the description must compensate, and it does for the high-risk ones: it defines what `source`, `expression`, `url`, `headers`, `ref`, `timeout_ms`, `filename` and `mime_type` mean and how they interact per mode. `page_id` and `frame` are left unexplained (frame is genuinely opaque), which is the only real gap.

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?

States a specific verb and resource (save a file from the page into workspace files) and names the downstream consumers (messages.send attachment_file_ids, files.* tools). The three source modes are introduced up front, so the agent knows exactly what operation it is selecting 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?

Explicitly routes between the three modes with concrete conditions: 'expression' for page-resident JS values, 'url' to fetch with the session's cookies, 'download' to click a `ref` button or capture the newest/pending download with a `timeout_ms` wait. It does not contrast with siblings such as browser_file_upload or browser_save_page, but the mode-selection guidance is unusually concrete.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.