Skip to main content
Glama
andresolbach

nodriver-mcp-server

Close page

close_page
Destructive

Close an open browser tab and get the updated list of remaining pages. Use close_browser to shut down the last tab.

Instructions

Close a single browser tab.

The last remaining tab cannot be closed — use close_browser to shut Chrome down entirely. Closing the selected page clears the selection, so subsequent tools fall back to the most recently opened tab.

Returns the remaining open pages, because indices shift when a tab closes: re-read them from this response rather than reusing older ones.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
browserNoWhich browser to act on. Each name is an independent Chrome, created on first use. Omit for the shared default; parallel agents each need their own name.default
page_idNoIndex of the page to close, as listed by list_pages. -1 (the default) closes the currently selected page.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.5.0
    • addedInput schema / properties / browser
      Added value: +{
      +  "default": "default",
      +  "description": "Which browser to act on. Each name is an independent Chrome, created on first use. Omit for the shared default; parallel agents each need their own name.",
      +  "type": "string"
      +}
  2. First observedv1.7.2

TDQS

A4.7/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, and idempotentHint=false. The description adds valuable context beyond these: the last-tab restriction, selection clearing side effect, and the fact that the tool returns remaining pages with shifted indices. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently written in three short paragraphs. The core action is front-loaded, followed by a key exception and then important side effects and return info. Every sentence adds value without redundancy.

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 simple two-parameter tool with a complete input schema and an output schema, the description fully covers usage, constraints, side effects, and return behavior. Nothing essential is missing for an agent to call it correctly.

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?

The input schema provides full descriptions for both parameters (browser and page_id), covering their defaults and meanings. The description does not add new parameter-specific semantics; it only reinforces the default behavior and return value, which are already in the schema. With 100% schema coverage, a baseline of 3 is appropriate.

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 states the specific verb 'close' with resource 'a single browser tab', making the action clear. It also distinguishes itself from close_browser by explicitly noting the last-tab limitation and the alternative for shutting down entirely.

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?

The description gives explicit when-to-use guidance: it states that the last remaining tab cannot be closed and instructs to use close_browser instead. It also explains the behavior after closing (selection cleared, fallback) and advises re-reading returned pages due to index shifts, which informs the agent on how to correctly use the tool's output.

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