Skip to main content
Glama
Browser Session MCP

Browser Session MCP

configure_session

Reads or updates a browser session's stealth, humanized input, CPU/network throttling, and init scripts, applying only specified fields while validating values and returning resulting settings.

Instructions

Read or change a session's settings: stealth, humanized input, CPU and network throttling, and init scripts. With only sessionId it changes nothing and returns every setting (a new session has stealth off, humanize on unless open_browser_session turned it off, no throttling and no init scripts). With any other field it applies just those fields, keeps the rest, and returns the settings that result. Every field is checked before anything changes, so a bad value changes nothing and the error names the field. Settings apply to every tab of the session, open now or opened later (popups included), until changed or the session closes.

Stealth: stealth: true disables the CDP Runtime domain (removes the Runtime.enable automation tell that anti-bot systems like Cloudflare detect); load and navigate pages in this mode to pass CDP-based bot gates. The cost is no console capture, and evaluate runs in an isolated world (can't read page globals like window.dataLayer). stealth: false brings both back, with the CDP tell. Typical flow: stealth true, navigate, stealth false, evaluate. Leave it off for sites without bot detection, and read it before evaluate or list_console_messages, whose behavior it changes.

Throttling measures a page as a slow phone or connection sees it (load time, hydration, layout shift, flaky taps); it is in place when this returns, so navigate right after. Typical mid-range phone: cpuThrottlingRate 4 with network "slow4g" and useMobileUA on open_browser_session. cpuThrottlingRate 1 and network "off" stop throttling.

Init scripts run JavaScript at the start of every page load, before any of the page's own scripts, in the page's main world (the page sees what they define). Use them to record timings or DOM changes from the very first moment of a load (a MutationObserver, PerformanceObserver or console hook writing to a window global you read later with evaluate), or to stub an API before the page uses it. They take effect from each tab's next navigation, not the page already loaded. addInitScripts returns their ids in addedInitScripts; removeInitScripts takes ids from initScripts, and fails on an id the session doesn't have. Throttling and init scripts need the listener role, and fail if no tab confirms within 5s.

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": {
      "sessionId": "<sessionId>"
    },
    "name": "configure_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
networkNoA preset ("slow3g", "slow4g", "fast4g" as in Chrome DevTools, "offline", or "off" for none) or custom {latencyMs, downloadKbps, uploadKbps}.
stealthNotrue turns stealth on, false turns it off.
humanizeNotrue makes input look human (curved cursor paths, a typing rhythm, wheel scrolling; a click takes about half a second), false makes it instant. On by default.
sessionIdYesThe id returned by open_browser_session. Errors if no open session has it.
addInitScriptsNoInit scripts to add, each { source }: the JavaScript to run, as a script body (not a function).
cpuThrottlingRateNoCPU slowdown factor from 1 (none) to 100. 4 is a mid-range phone, 6 a low-end one.
removeInitScriptsNoIds of init scripts to remove, from `initScripts`. Pages already loaded keep what they did.

Output Schema

NameRequiredDescriptionDefault
networkYesNetwork throttling; null means none.
stealthYesWhether stealth is on: no CDP Runtime domain, so no console capture and `evaluate` in an isolated world.
humanizeYesWhether input is humanized: curved cursor paths, a typing rhythm and wheel scrolling.
initScriptsYes
addedInitScriptsNoIds of the init scripts this call added, in the order given.
cpuThrottlingRateYesCPU slowdown factor; 1 means none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare it is non-read-only and non-destructive; the description goes far beyond by disclosing atomic validation ('Every field is checked before anything changes, so a bad value changes nothing and the error names the field'), scope of application (every tab, including future popups), the stealth trade-off (no console capture, evaluate in an isolated world), init-script timing (next navigation, not the loaded page), the listener-role requirement and the 5s confirmation timeout. These are exactly the mutation semantics an agent needs and none are in the annotations.

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 the read/write contract before any per-field prose, then sectioned by setting family so an agent can skim to the relevant paragraph. It is long, but the length is proportionate to a seven-parameter tool with three distinct subsystems; a few clauses (e.g. the Cloudflare aside) are decorative rather than operational.

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?

An output schema exists, so return values need not be restated, yet the description still notes that the resulting settings are returned and how added init-script ids come back. Combined with atomicity, permissions, timeout, and tab-scope coverage, nothing an agent needs to call this correctly is missing.

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 coverage is already 100% with good per-parameter descriptions, so the baseline is 3; the description earns extra credit by adding meaning the schema lacks — stealth's downstream effect on evaluate and console capture, 'cpuThrottlingRate 1 and network "off" stop throttling', addInitScripts returning ids in `addedInitScripts`, and removeInitScripts failing on an unknown id. The humanize field is only named in the opening list and its behavior is left to the schema, which keeps this short of a 5.

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?

Opens with a specific verb+resource ('Read or change a session's settings') and immediately enumerates the setting families (stealth, humanize, throttling, init scripts). It also splits the two modes precisely: 'With only sessionId it changes nothing and returns every setting' versus 'With any other field it applies just those fields, keeps the rest'. An agent can tell this apart from open_browser_session 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 Guidelines5/5

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

Gives explicit sequencing advice: 'Typical flow: stealth true, navigate, stealth false, evaluate', and 'navigate right after' throttling is set. It names the when-not condition ('Leave it off for sites without bot detection') and warns to read stealth before evaluate or list_console_messages. Guidance is prescriptive rather than implied.

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