Skip to main content
Glama

set_session_auth

Inject captured browser credentials into Playwright for authentication flows like Google OAuth, enabling automated testing of restricted login pages.

Instructions

Inject user-browser credentials into Playwright (restricted auth). ALWAYS saves profileId; optional sessionId applies to a live session.

BEFORE calling this tool: you MUST already have sent the user (same conversation) the login URL + Network Cookie steps + JS snippet from server instructions. Never call this tool "speculatively" without first giving those instructions. Never open headed login for Google OAuth — use this flow.

Triggers: Google OAuth / Sign in with Google, Gmail/Google apps, Microsoft/Entra, Apple, Discord OAuth, Cloudflare Turnstile on login, Okta/Auth0 social IdP, or any login Playwright cannot complete.

Accepts credentialsJson from the console snippet (Cookie header + storage) or Playwright storageState JSON.

Example (after user pastes):

{
  "siteUrl": "https://mail.google.com/",
  "credentialsJson": "{...paste from user...}"
}

Returns: { "ok": true, "profileId": "prof_…", "strategy": "restricted_auth" }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
authUrlNoOptional auth URL for profile meta (defaults to siteUrl)
siteUrlYesTarget application URL (inject / navigate origin)
sessionIdNoIf set, also inject credentials into this live session
credentialsJsonYesJSON paste from the restricted-auth console snippet (Network Cookie header + storage) or Playwright storageState. Only call set_session_auth after the user was given the login URL + snippet and has pasted this JSON.
Behavior4/5

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

With no annotations, the description carries the full burden. It describes the tool as injecting credentials, saving a profileId, and optionally applying to a live session. It explains the input format (credentialsJson from console snippet) and the output. However, it does not explicitly state that the operation is destructive (e.g., overwriting existing credentials) or mention any side effects beyond the return. Still, it provides sufficient behavioral context for an agent to understand the action.

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 and front-loaded: the first sentence gives the core purpose. Prerequisites are highlighted in uppercase for emphasis. Triggers are listed in a bullet-style format. An example is provided. No unnecessary words or redundancy.

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?

Given the 4 parameters (2 required) and no output schema, the description covers all necessary aspects: input format, output structure, usage prerequisites, and trigger scenarios. It provides enough context for an agent to correctly select and invoke the 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?

The schema already has 100% coverage with descriptions for all parameters. The description adds value by clarifying the role of siteUrl ('inject/navigate origin') and credentialsJson ('paste from the restricted-auth console snippet or Playwright storageState'). It includes an example mapping parameters to usage, which is helpful for proper invocation.

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 the tool's purpose: 'Inject user-browser credentials into Playwright (restricted auth).' It specifies the action (inject), the resource (Playwright), and the context (restricted auth). It also distinguishes from siblings by mentioning it is for flows like Google OAuth and other social IdPs that Playwright cannot complete.

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?

The description provides explicit when-to-use guidance: a list of triggers (e.g., Google OAuth, Microsoft/Entra). It also states prerequisites: 'BEFORE calling this tool: you MUST already have sent the user... the login URL + Network Cookie steps + JS snippet.' It includes a warning: 'Never call this tool speculatively.' This is thorough and leaves no ambiguity.

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/Macioa/EasyPlaywrightMCP'

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