Skip to main content
Glama

browser.close_session

Destructive

Close a browser session and finalize its trace and artifacts, ending the run and preserving recorded data for review.

Instructions

Close a session and finalize its trace/artifacts.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "browser.close_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
session_idNoTarget session id, from browser.create_session or browser.list_sessions. Optional when exactly one session is live; observe and act tools create one when none is.
approval_idNoID of the granted approval for exactly this call, from its approval_required answer.
workflow_profileNogoverned: a call that can change something waits for approval. It answers status approval_required with an approval_id; call again with that id once it is granted. fast, the default, runs it directly unless this tool or deployment always requires approval.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.19.0
    • addedInput schema / properties / approval_id
      Added value: +{
      +  "description": "ID of the granted approval for exactly this call, from its approval_required answer.",
      +  "type": "string"
      +}
    • addedInput schema / properties / workflow_profile
      Added value: +{
      +  "description": "governed: a call that can change something waits for approval. It answers status approval_required with an approval_id; call again with that id once it is granted. fast, the default, runs it directly unless this tool or deployment always requires approval.",
      +  "enum": [
      +    "fast",
      +    "governed"
      +  ],
      +  "type": "string"
      +}
  2. Addedv1.8.1
  3. Removedv1.4.2
  4. Changed1 schema field changedv1.4.2
    • addedInput schema / properties / session_id / description
      Added value: +"ID of the target browser session, as returned by browser.create_session or listed by browser.list_sessions."
  5. Changed3 schema fields changedv1.0.3
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / session_id / maxLength
      Added value: +120
    • addedInput schema / properties / session_id / minLength
      Added value: +1
  6. First observedv0.5.0

TDQS

B3.2/5.0
Behavior3/5

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

Annotations already flag destructiveHint=true, readOnlyHint=false and idempotentHint=false, so the safety profile is covered structurally. The description's one contribution is that closing finalizes the trace/artifacts, which hints at what is flushed on close, but it says nothing about what is lost (open tabs, cookies, downloads) or what happens if the session is already gone.

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 front-loaded sentence with no filler. It is slightly under-specified for a destructive tool, but no wording is wasted.

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

Completeness3/5

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

For a destructive, non-idempotent session-terminating operation with no output schema, the description leaves out consequential details: effect on open tabs, irreversibility of the session, and error behavior on an already-closed session. It is adequate but thin.

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 description coverage is 100%, with session_id, approval_id, and workflow_profile all documented in the input schema. The description adds no parameter meaning beyond that, so the baseline of 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?

States a specific verb and resource ("Close a session") plus the side effect of finalizing trace/artifacts. That is enough to separate it from browser.close_tab, which closes a tab rather than the whole session, though the description never names that sibling explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance at all: no note on when to close a whole session versus a single tab, no prerequisites, and no mention of the optional-session_id shortcut or approval flow, both of which live only in the schema.

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