Skip to main content
Glama

set_page_data

Bypasses CDP's 1 MB per-message limit by chunking large payloads into window.__pb_data for debugging or stubbing responses in the browser.

Instructions

Write a large payload (>1 MB) to window.__pb_data[key] in the page, bypassing the CDP 1 MB-per-message limit via server-side chunking. Use when: passing big base64 images / JSON / fixtures to a debug hook (window.__yourHook(data)), stubbing fetch responses with large bodies, or feeding binary data to a custom drop-zone. Sources: inline (pass data directly — useful for known small payloads) or file (pass absolute path, server reads as binary). After this call the page can read window.__pb_data[''] (string OR ArrayBuffer depending on encoding) and window.__pb_data['__complete'] === true once all chunks landed. Note: each call chunks sequentially over the CDP WebSocket — do NOT issue multiple set_page_data calls for the same key in parallel; concurrent writes would race on window.__pb_data[key]. Do NOT use for: small (<200 KB) payloads where a single evaluate works, or where file_upload with an would suffice.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesProperty name under window.__pb_data (JS identifier — letters, digits, underscore; cannot start with digit)
sourceYesWhere to read the payload from. type 'inline' → pass `data` as a string. type 'file' → pass absolute `path`; the server reads the file as binary.
encodingNoEncoding interpretation. 'utf8' (default for inline) keeps the data as a string. 'binary' (default for file) decodes to ArrayBuffer in the page so apps can pass it to FileReader / Blob / fetch body. 'base64' keeps the base64 string as-is (the page can decode it itself).
chunkSizeNoRaw bytes per chunk before base64 encoding. Default 500_000 (~670 KB base64, safe under CDP's 1 MB-per-message limit). Capped at 700_000 (~933 KB base64) to leave safety margin.
Behavior5/5

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

Given no annotations, the description fully discloses chunking, CDP sequential order, race condition, encoding defaults, chunkSize cap, and post-call state (__complete flag).

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?

Description is lengthy but every sentence provides value; front-loaded with purpose and constraints. Minor redundancy could be tightened.

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?

Covers all aspects: purpose, usage, parameters, behavior, and post-call state without output schema. Complete for a complex chunking tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but description adds context for each parameter: encoding defaults, chunkSize limit, source options meaning, and key format constraints.

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 clearly states it writes a large payload (>1 MB) to window.__pb_data[key] via server-side chunking, distinguishing it from siblings like evaluate and file_upload.

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?

Explicitly provides 'Use when' scenarios (big base64 images, stubbing fetch responses, feeding binary data) and 'Do NOT use for' situations (small payloads, file_upload), plus concurrency warning.

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/Silbercue/public-browser'

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