Skip to main content
Glama

session

Maintain a persistent browser session with cookies and JavaScript state across calls. Use it to log in, click, fill forms, or execute JS for multi-step flows on protected pages.

Instructions

Drive a persistent browser session — cookies & JS state kept across calls.

Use for login walls and multi-step flows the one-shot ladder can't handle (e.g. user needs to log in first, then scrape a protected page). For simple pages use scrape; for research use deep_research.

One-shot scrape has no session memory; here each action runs against the same live page.

Args: session: named session; reuse the same name to keep state. action: "open" (url) — navigate, returns url/title/status "click" (selector) — click an element "fill" (selector, text) — type into an input "type" (key) — press a key, e.g. "Enter" "eval" (js) — run a JS expression, returns value "wait" (selector?) — wait for selector or sleep timeout_ms "content" — url/title/visible text of current page "screenshot" (full_page?) — returns png_base64 "cookies" — list session cookies "close" — destroy the session "list" — show live sessions Returns {session, action, ...result, elapsed_ms}; errors as {error}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jsNo
keyNo
urlNo
textNo
actionNoopen
sessionNodefault
headlessNo
selectorNo
full_pageNo
timeout_msNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.1

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden and meets it: it enumerates every action (open, click, fill, type, eval, wait, content, screenshot, cookies, close, list) with their effects, explicitly states 'close — destroy the session' as destructive, and specifies the return format ('Returns {session, action, ...result, elapsed_ms}; errors as {error}'). It also discloses persistence of cookies and JS state.

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?

The description is well-structured: it opens with purpose, then usage guidelines, then the stateful vs one-shot distinction, followed by a concise action-by-action list and return format. Every sentence adds value; the length is justified by the tool's complexity but remains scannable and front-loaded.

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 tool with 10 parameters and 12 actions, this description is extraordinarily complete: it covers purpose, invocation conditions, all actions with their inputs and outputs, return and error formats, and distinguishes from siblings. An output schema exists, so return values don't need further explanation. Nothing essential for correct use 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 has 0% description coverage, so the description must compensate. It does so well by detailing parameters under 'Args:' including session, and for each action the relevant parameters (url, selector, text, key, js, full_page, timeout_ms). However, the `headless` parameter is never mentioned in the description, leaving its purpose undocumented—a minor gap given the otherwise thorough coverage.

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 purpose: 'Drive a persistent browser session — cookies & JS state kept across calls.' This clearly identifies the tool as a session manager and differentiates it from one-shot tools like scrape and deep_research, which are explicitly named as alternatives.

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?

Provides explicit usage guidance: 'Use for login walls and multi-step flows the one-shot ladder can't handle' and tells exactly when to use alternatives: 'For simple pages use `scrape`; for research use `deep_research`.' Also clarifies the key distinction: 'One-shot scrape has no session memory; here each action runs against the same live page.' This leaves no ambiguity about when to invoke this tool.

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