Skip to main content
Glama
CapMonsterCloud

capmonster-mcp-patchright

Official

browser_save_blob

Run JavaScript in the page and save the result directly to a disk file, preventing corruption of large base64, HTML, or JSON blobs during transfer.

Instructions

Evaluate JavaScript in the page and write the result straight to a file on disk — the value itself never passes through this tool's response. Use this instead of browser_evaluate whenever you need to get a large/opaque blob (base64 image(s), a full page's HTML, a big JSON dump) out of the live page and into a request body: reading it via browser_evaluate and then re-typing/pasting it into another tool call's arguments (e.g. create_task's imagesBase64/htmlPageBase64) risks silently corrupting it — a dropped character or an unclosed quote partway through a multi-KB string merges what should be several array elements into one, with no clear error. Pass 'function' or 'expression' (same as browser_evaluate); pass encoding:'base64' when the value is a base64 string (a data:...;base64, prefix is stripped automatically) to write raw decoded bytes, or omit it to write the value as UTF-8 text (non-strings are JSON-stringified).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesOutput file path.
worldNoExecution world. 'isolated' (default) = stealth, page globals hidden; 'main' = page's real world, page globals visible/callable.
encodingNo'base64' decodes the evaluated string into raw bytes before writing. 'text' (default) writes UTF-8 (JSON-stringifying non-string results).
functionNo
expressionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and covers key traits: results are written directly to disk, never returned in the response, base64 data prefixes are stripped automatically, and non-strings are JSON-stringified in text mode. It does not state whether existing files are overwritten or describe error/return behavior, leaving some side-effect ambiguity.

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 purpose is front-loaded, but the description is a long, dense paragraph with a lengthy corruption warning and several parentheticals. Every part is relevant, but breaking it into clearer sentences would improve quick scanning.

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 tool with no annotations and no output schema, this is largely complete: it covers purpose, when to use it, encoding behavior, and the fact that the value is not returned. Minor gaps remain around file overwrite behavior, the exact response format, and clarifying that one of function/expression must be supplied.

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?

The schema describes path, world, and encoding, but function/expression have no schema descriptions. The description fills this gap by saying to pass 'function' or 'expression' (same as browser_evaluate) and adds encoding details beyond the schema: base64 prefix stripping and JSON-stringification of non-strings. It could more explicitly state that one of function/expression is required.

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 and resource: 'Evaluate JavaScript in the page and write the result straight to a file on disk.' It also distinguishes itself from browser_evaluate by emphasizing that the value never passes through the tool's response, making its purpose clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly names browser_evaluate as the alternative and gives the exact condition for choosing this tool: when a large/opaque blob (base64, full HTML, big JSON) needs to leave the live page and enter a request body. It also warns against the corruption risk of reading via browser_evaluate and re-typing the value into another tool call.

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