Skip to main content
Glama
Browser Session MCP

Browser Session MCP

swipe

Destructive

Simulates real touch gestures across a mobile browser tab to close drawers, move carousels, pull to refresh, or scroll by starting on an element or coordinates and dragging a set distance.

Instructions

Swipe a finger across the session's active tab with real CDP touch input (touchstart, touchmove, touchend, and the matching pointer events), e.g. to close a drawer, move a carousel, pull to refresh or scroll the way a phone does. Start on an element (selector, or plain words as for click), at x,y, or by default the middle of the screen; end distance pixels away in direction (default 60% of the screen along that axis) or exactly at toX,toY. durationMs sets the speed (default 300): short and slow drags a drawer partway, to check it snaps back. Use it on mobile sessions (open_browser_session with useMobileUA); pages that listen only for mouse events won't react. Returns where the swipe started and ended.

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": "swipe"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNoStart, horizontal viewport coordinate, used with `y` when no selector is given.
yNoStart, vertical viewport coordinate, used with `x` when no selector is given.
toXNoEnd, horizontal viewport coordinate, with `toY`; overrides `direction`.
toYNoEnd, vertical viewport coordinate, with `toX`; overrides `direction`.
timeoutNoMilliseconds to wait for `selector` to appear. Default 5000.
distanceNoHow far to move in `direction`, in CSS pixels. Default 60% of the screen's width (left, right) or height (up, down).
selectorNoElement to start on (its center): a CSS selector, or plain words as for click.
directionNoWhich way the finger moves. Needed unless `toX` and `toY` are given.
sessionIdYesThe id returned by open_browser_session. Errors if no open session has it.
durationMsNoHow long the finger takes to move, in milliseconds. Default 300.

Output Schema

NameRequiredDescriptionDefault
hitNoWhat was at the clicked or tapped point.
urlYesThe page's URL after the action.
titleYesThe page's title after the action.
dialogNoAn open dialog's text, if one is showing.
changedNoA field `type` filled that the page changed once focus left it (a date that reformats or reverts on blur), with both texts.
focusedYesThe element with keyboard focus, or "nothing".
optionsNoThe options of a dropdown or list open after the action (the one the focused field controls, else any showing), up to 50: pick one with select_option or click.
answeredNoThe page's own dialogs (alert, confirm, prompt, "Leave site?") answered since the last action, each accepted.
rejectedNoFields the page rejected during the action, each with its message: the browser's own form check (a required field left empty), or the page marking them invalid. The form wasn't sent while any remain.
navigatedYesWhether the URL changed.
focusTrailNoWith press_key's `repeat`: the focused element after each press.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.23
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "properties": {
      +    "answered": {
      +      "description": "The page's own dialogs (alert, confirm, prompt, \"Leave site?\")\nanswered since the last action, each accepted.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "changed": {
      +      "description": "A field `type` filled that the page changed once focus left it (a\ndate that reformats or reverts on blur), with both texts.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "dialog": {
      +      "description": "An open dialog's text, if one is showing.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "focusTrail": {
      +      "description": "With press_key's `repeat`: the focused element after each press.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "focused": {
      +      "description": "The element with keyboard focus, or \"nothing\".",
      +      "type": "string"
      +    },
      +    "hit": {
      +      "description": "What was at the clicked or tapped point.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "navigated": {
      +      "description": "Whether the URL changed.",
      +      "type": "boolean"
      +    },
      +    "options": {
      +      "description": "The options of a dropdown or list open after the action (the one the\nfocused field controls, else any showing), up to 50: pick one with\nselect_option or click.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": [
      +        "array",
      +        "null"
      +      ]
      +    },
      +    "rejected": {
      +      "description": "Fields the page rejected during the action, each with its message:\nthe browser's own form check (a required field left empty), or the\npage marking them invalid. The form wasn't sent while any remain.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "title": {
      +      "description": "The page's title after the action.",
      +      "type": "string"
      +    },
      +    "url": {
      +      "description": "The page's URL after the action.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "url",
      +    "title",
      +    "navigated",
      +    "focused"
      +  ],
      +  "type": "object"
      +}
  2. Addedv0.1.18

TDQS

A4.1/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true and idempotentHint=false, so the agent knows gestures can have side effects. The description adds real behavioral context beyond that: the dispatched event types, the mobile-only precondition, the short-and-slow-drag pattern for testing snap-back, and that start/end coordinates are returned. It stops short of stating what page state can be altered or how failures surface, which matters for a destructive-hint tool.

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 action and mechanism, then defaults, then the mobile caveat. Dense but almost every clause carries information; a few defaults are repeated from the schema, costing a little redundancy but not 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 10-parameter gesture tool with an output schema, the description covers mechanism, coordinate modes, defaults, timing semantics, and the mobile-session precondition. Since return values are declared by the output schema, the short note about returning start/end points is sufficient; only failure behavior is left unaddressed.

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 100%, so the baseline is 3, and the description adds real meaning on top: default distance is 60% of the screen along the chosen axis, durationMs defaults to 300, selector center vs explicit x/y start, and toX/toY overriding direction. The only missed nuance is the selector timeout interaction, which the schema already documents.

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 verb and resource (swipe the session's active tab) and pins the mechanism precisely: real CDP touch input with touchstart/touchmove/touchend plus matching pointer events. The gesture examples (close a drawer, move a carousel, pull to refresh) make it distinguishable from sibling gesture tools like click and scroll.

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?

Explicitly scopes usage to mobile sessions (open_browser_session with useMobileUA) and warns that mouse-only pages won't react, which is a clear when-not condition. It implies selector/coordinate handling matches click but never names a sibling alternative such as scroll for desktop pages, so routing guidance is strong but not exhaustive.

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