Skip to main content
Glama
Browser Session MCP

Browser Session MCP

tap

Destructive

Simulates real finger touch in the active browser tab to trigger touch, pointer, and click events on mobile sessions; use a selector or x/y coordinates instead of mouse clicks.

Instructions

Tap in the session's active tab with a finger: real CDP touch input, so the page gets touch events, pointer events with pointerType "touch" and the click a tap makes. Use it on mobile sessions (open_browser_session with useMobileUA, which also makes the page see a touch screen) for anything a phone user would tap; click sends mouse input instead. Pass a CSS selector (or plain words, resolved by Jev as for click) to tap the first match's center after waiting up to timeout for it, or both x and y for viewport coordinates. A tap can submit forms or trigger purchases, like a real user's. Returns a confirmation naming what was tapped.

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

Input Schema

NameRequiredDescriptionDefault
xNoHorizontal viewport coordinate in CSS pixels, used with `y` when no selector is given.
yNoVertical viewport coordinate in CSS pixels, used with `x` when no selector is given.
timeoutNoMilliseconds to wait for `selector` to appear. Default 5000.
selectorNoCSS selector of the element to tap; the first match is used. Or describe it in plain words, as for click.
sessionIdYesThe id returned by open_browser_session. Errors if no open session has it.

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.8/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and openWorldHint=true, but the description goes further by explaining why: "A tap can submit forms or trigger purchases, like a real user's." It also discloses the wait-until-appears behavior tied to `timeout` and states that a confirmation naming the tapped element is returned, which annotations alone do not convey.

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?

It is front-loaded with the mechanism and the click contrast before moving to parameters, and no sentence is filler. It runs long and occasionally bundles several ideas into one clause (plain-words selector resolution, timeout semantics), which slightly taxes scanning.

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 five-parameter action tool with an output schema already present, the description covers mechanism, targeting modes, timing, risk of side effects, and use-case routing. Nothing an agent needs to call it correctly 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 coverage is 100%, so the baseline is 3, but the description adds real meaning: `selector` accepts plain words resolved the same way as for click, the first match's center is used, and `timeout` governs waiting for that selector. The x/y pairing is mostly a restatement of the schema's own descriptions.

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 names a concrete verb and target ("Tap in the session's active tab") and specifies the underlying mechanism (real CDP touch input producing touch events and pointerType "touch"). It explicitly contrasts with the sibling click tool, so an agent can distinguish the two without opening either schema.

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?

It states the condition for use (mobile sessions created via open_browser_session with useMobileUA) and names the alternative: "click sends mouse input instead." It also covers the two mutually exclusive targeting modes (selector vs. x/y), which is the main invocation decision an agent faces.

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