Skip to main content
Glama
alterlab-mcp-server

alterlab-mcp-server

Create Session

alterlab_create_session

Create a stored authenticated scraping session from browser cookies to scrape login-protected sites and reuse it across requests via session_id. Requires explicit consent.

Instructions

Create a new stored session for authenticated scraping. Provide cookies from a logged-in browser session to enable scraping behind login walls. The session is stored securely and can be reused across multiple scrape requests via session_id. Requires consent=true (explicit GDPR consent to store the cookies); optional headers, expires_at, notes, auto_refresh/notification flags and organization sharing are supported.

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": {
      "name": "<name>",
      "domain": "<domain>",
      "consent": "<consent>"
    },
    "name": "alterlab_create_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesHuman-readable name for this session (e.g., 'My Amazon Account')
notesNoFree-text notes about this session
domainYesDomain this session is for (e.g., 'amazon.com')
sharedNoShare the session with organization members immediately (API default false)
consentYesExplicit GDPR consent from the account owner to store these session cookies. Must be true — the API rejects session creation with CONSENT_REQUIRED otherwise. Only set true after the user has agreed to AlterLab storing their cookies.
cookiesNoCookies for authentication. Cookies as a {name: value} object (e.g. {"session-id": "abc123"}) or as a list (max 100) of cookie objects with metadata: {name, value, domain?, path?, secure?, httpOnly?, sameSite?, expires?}.
headersNoCustom headers sent with this session (e.g., a User-Agent or Authorization header)
expires_atNoSession expiry in ISO 8601 format (e.g., '2026-12-31T23:59:59Z')
organization_idNoOrganization to assign the session to (org admins only)
notify_on_failureNoNotify when session validation fails (API default true)
auto_refresh_enabledNoEnable proactive expiry detection and health checks (API default true)
notify_before_expiryNoNotify when the session is about to expire (API default true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed17 schema fields changedv1.9.0
    • addedInput schema / properties / auto_refresh_enabled
      Added value: +{
      +  "description": "Enable proactive expiry detection and health checks (API default true)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / consent
      Added value: +{
      +  "description": "Explicit GDPR consent from the account owner to store these session cookies. Must be true — the API rejects session creation with CONSENT_REQUIRED otherwise. Only set true after the user has agreed to AlterLab storing their cookies.",
      +  "type": "boolean"
      +}
    • removedInput schema / properties / cookies / additionalProperties
      Removed value: -{
      -  "type": "string"
      -}
    • addedInput schema / properties / cookies / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": {
      +      "type": "string"
      +    },
      +    "type": "object"
      +  },
      +  {
      +    "items": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "domain": {
      +          "type": "string"
      +        },
      +        "expires": {
      +          "type": "number"
      +        },
      +        "httpOnly": {
      +          "type": "boolean"
      +        },
      +        "name": {
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "path": {
      +          "type": "string"
      +        },
      +        "sameSite": {
      +          "type": "string"
      +        },
      +        "secure": {
      +          "type": "boolean"
      +        },
      +        "value": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "name",
      +        "value"
      +      ],
      +      "type": "object"
      +    },
      +    "maxItems": 100,
      +    "type": "array"
      +  }
      +]
    • changedInput schema / properties / cookies / description
      Previous value: -"Cookie key-value pairs for authentication (e.g., {\"session-id\": \"abc123\", \"session-token\": \"xyz789\"})"New value: +"Cookies for authentication. Cookies as a {name: value} object (e.g. {\"session-id\": \"abc123\"}) or as a list (max 100) of cookie objects with metadata: {name, value, domain?, path?, secure?, httpOnly?, sameSite?, expires?}."
    • removedInput schema / properties / cookies / type
      Removed value: -"object"
    • addedInput schema / properties / domain / maxLength
      Added value: +255
    • changedInput schema / properties / domain / minLength
      Previous value: -1New value: +3
    • addedInput schema / properties / expires_at
      Added value: +{
      +  "description": "Session expiry in ISO 8601 format (e.g., '2026-12-31T23:59:59Z')",
      +  "type": "string"
      +}
    • addedInput schema / properties / headers
      Added value: +{
      +  "additionalProperties": {
      +    "type": "string"
      +  },
      +  "description": "Custom headers sent with this session (e.g., a User-Agent or Authorization header)",
      +  "type": "object"
      +}
    • addedInput schema / properties / notes
      Added value: +{
      +  "description": "Free-text notes about this session",
      +  "maxLength": 1000,
      +  "type": "string"
      +}
    • addedInput schema / properties / notify_before_expiry
      Added value: +{
      +  "description": "Notify when the session is about to expire (API default true)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / notify_on_failure
      Added value: +{
      +  "description": "Notify when session validation fails (API default true)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / organization_id
      Added value: +{
      +  "description": "Organization to assign the session to (org admins only)",
      +  "format": "uuid",
      +  "type": "string"
      +}
    • addedInput schema / properties / shared
      Added value: +{
      +  "description": "Share the session with organization members immediately (API default false)",
      +  "type": "boolean"
      +}
    • removedInput schema / properties / user_agent
      Removed value: -{
      -  "description": "Browser User-Agent string to use with this session",
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "name",
      -  "domain",
      -  "cookies"
      -]New value: +[
      +  "name",
      +  "domain",
      +  "consent"
      +]
  2. First observedv1.5.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare this is a non-read-only, non-destructive, open-world, non-idempotent write. The description adds genuinely useful behavior: server-side secure storage, the consent=true precondition with the CONSENT_REQUIRED failure mode, and reusability via session_id. It does not address duplicate creation, what the response contains, or how cookie expiry interacts with auto-refresh.

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?

A single tight paragraph, front-loaded with purpose then the consent precondition then the optional surface. The trailing enumeration of optional flags is slightly list-like filler since the schema covers them, but nothing is redundant enough to harm readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 12-parameter mutating tool with a nested cookie schema and no output schema, the description covers the essential shape: what it stores, why consent is mandatory, and how the result is consumed. The only real gap is that it never indicates what is returned (a session_id / session object) on success.

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

Parameters3/5

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

Schema coverage is 100%, so every parameter including the nested cookie object is already documented in detail. The description summarizes the optional groups (headers, expires_at, notes, notification flags, org sharing) and explains the GDPR rationale behind consent, but adds no syntax or semantics beyond what the schema states — baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Create a new stored session for authenticated scraping,' and immediately adds the distinguishing capability — replaying cookies from a logged-in browser session. That separates it from the read/validate/refresh session siblings, though it never names those siblings explicitly.

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?

It states the triggering condition clearly ('to enable scraping behind login walls') and explains downstream use ('reused across multiple scrape requests via session_id'), which tells the agent this is a setup step preceding scrape calls. It gives no explicit 'when not to use' or routing to alterlab_update_session / alterlab_list_sessions for existing sessions.

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