Skip to main content
Glama
andresolbach

nodriver-mcp-server

Set localStorage

set_local_storage
Idempotent

Write string values into the current page's localStorage to set feature flags, consent state, or auth tokens before page scripts read them. Navigate to the target site first, then reload to apply.

Instructions

Write entries into the current page's localStorage.

Merges into what is already there rather than clearing it. Handy for setting feature flags, consent state or auth tokens before the page's own scripts read them.

localStorage is scoped per origin, so navigate to the site first — writing on about:blank goes nowhere. Most pages read these values only at startup, so reload after setting them.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesKey-value pairs to write, e.g. {"token": "abc", "locale": "de"}. Values must be strings — JSON-encode anything structured yourself.
browserNoWhich browser to act on. Each name is an independent Chrome, created on first use. Omit for the shared default; parallel agents each need their own name.default

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.5.0
    • addedInput schema / properties / browser
      Added value: +{
      +  "default": "default",
      +  "description": "Which browser to act on. Each name is an independent Chrome, created on first use. Omit for the shared default; parallel agents each need their own name.",
      +  "type": "string"
      +}
  2. First observedv1.7.2

TDQS

A4.7/5.0
Behavior5/5

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

Beyond the annotations, the description reveals important behavioral traits: it merges rather than clears, localStorage is origin-scoped, writes on about:blank are lost, and most pages read these values only at startup so a reload is needed. This gives the agent actionable expectations that the annotations alone do not 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?

Four short sentences deliver the core action, the merge behavior, the origin scoping caveat, and the reload tip with no filler. The most important information is front-loaded and every sentence earns its place.

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?

For a two-parameter tool with a fully described schema and output schema present, the description covers everything an agent needs to invoke it correctly: what it does, how it merges, when it is useful, what page context is required, and what to do afterward. No essential operational context 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?

The schema already describes both parameters at 100% coverage, including the string-only value constraint and browser naming semantics. The description adds value by clarifying that items are merged into existing storage rather than replacing it, which directly affects how the items parameter behaves.

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 opens with 'Write entries into the current page's localStorage,' a specific verb and resource that clearly differentiates it from sibling get_local_storage and from evaluate_script. It also immediately distinguishes the merge behavior, so an agent knows exactly what operation this tool performs.

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?

The description gives clear contextual guidance: it is handy for feature flags, consent state, or auth tokens before page scripts read them, and it warns to navigate to the site first because about:blank storage goes nowhere. It stops short of explicitly contrasting this tool against alternatives like evaluate_script, so it earns a 4 rather than a 5.

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