Skip to main content
Glama
Playwright DevTools MCP Server

Playwright DevTools MCP Server

by ariangibson

browser_close

Closes the browser context identified by contextId and releases its associated resources to end that browsing session cleanly.

Instructions

Close a browser context and clean up resources

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": {
      "contextId": "<contextId>"
    },
    "name": "browser_close"
  }
}

Input Schema

NameRequiredDescriptionDefault
contextIdYesBrowser context ID to close

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the whole behavioral burden. 'Clean up resources' hints that state is discarded, but it does not say what is lost (pages, cookies, storage), whether the call is idempotent, or how an unknown/expired contextId is handled.

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 seven-word sentence with the action front-loaded and no filler. It is efficient, though so terse that no secondary context (preconditions, effects) survives.

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 simple one-parameter teardown tool without an output schema, the definition is minimally sufficient to invoke correctly. It falls short on consequences of closing a context and on what the agent should do afterward.

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?

Only one parameter exists and the schema documents it at 100% coverage ('Browser context ID to close'). The description adds no further meaning such as where a contextId comes from, 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: closing a browser context, plus the cleanup effect. It is clear what the tool does, but it never distinguishes itself from siblings such as browser_force_recreate or browser_launch, which likely also tear down contexts.

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 guidance on when to call this versus recreating or relaunching a browser, and no precondition stated (e.g., the contextId must refer to a currently open context). The agent must infer the calling context entirely from the tool name.

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