Skip to main content
Glama
andresolbach

nodriver-mcp-server

Close page

close_page
Destructive

Closes a single browser tab, returning the updated list of remaining open pages so indices can be re-read.

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
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
Behavior5/5

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

Beyond the destructiveHint annotation, the description reveals critical behavioral traits: the last-tab restriction, selection clearing with fallback to the most recently opened tab, and index shifting. It also instructs the user to re-read remaining page indices from the response, preventing stale references. This is rich, actionable context that annotations alone do not provide.

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 concise and well-structured: a one-sentence purpose, then a caveat with an alternative, then an important behavioral note about selection, and finally a critical instruction about return values. Every sentence contributes value with no redundancy or fluff.

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 tool with a single optional parameter, the description covers all essential aspects: the action, edge cases (last tab), side effects on selection, and return semantics. The availability of an output schema reduces the need to detail the exact return format, but the description still mentions the key behavior of returning remaining pages. This is complete for the tool's complexity.

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?

The schema already provides 100% coverage for page_id, including the -1 default and its meaning. The description goes further by noting that indices shift after a close, implying that page_id values become stale and must be refreshed from the response. This adds semantic value beyond the schema, earning a 4 rather than a baseline 3.

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 opens with 'Close a single browser tab,' which is a specific verb-resource pair that immediately distinguishes this from close_browser. It also clarifies the constraint that the last tab cannot be closed, reinforcing the tool's exact scope. This clearly differentiates it from related sibling tools.

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 explicitly states when to use an alternative: 'The last remaining tab cannot be closed — use close_browser to shut Chrome down entirely.' This provides an explicit exclusion and directs users to the correct sibling tool. Additionally, it explains the selection-fallback behavior, giving clear context for when this tool is appropriate.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/andresolbach/nodriver-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server