Skip to main content
Glama
andytango
by andytango

new_tab

Open a new browser tab for navigation or automation tasks, optionally loading a specific URL immediately upon creation.

Instructions

Open a new browser tab, optionally navigating to a URL. The new tab becomes active.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoURL to navigate to in the new tab

Implementation Reference

  • Core handler implementation: creates a new Puppeteer Page (tab), generates ID, registers it in state, activates it, optionally navigates to URL, returns TabInfo.
    /**
     * Create a new tab
     * @param url Optional URL to navigate to
     * @returns Result with tab info
     */
    export async function createTab(url?: string): Promise<Result<TabInfo>> {
      const browserResult = await ensureInitialized();
      if (!browserResult.success) {
        return browserResult;
      }
    
      try {
        const page = await browserResult.data.newPage();
        const tabId = generateTabId();
    
        registerPage(tabId, page);
        state.activeTabId = tabId;
    
        if (url) {
          await page.goto(url);
        }
    
        return ok({
          id: tabId,
          url: page.url(),
          title: await page.title(),
          isActive: true,
        });
      } catch (error) {
        const message = error instanceof Error ? error.message : String(error);
        return err(browserNotLaunched());
      }
    }
  • Zod schema for new_tab tool input: optional URL.
    export const newTabSchema = z.object({
      url: z.string().url().optional().describe('URL to navigate to in the new tab'),
    });
  • Registers the new_tab tool with MCP server, providing name, description, input schema, and thin handler wrapper around createTab.
    // Create new tab
    server.tool(
      'new_tab',
      'Open a new browser tab, optionally navigating to a URL. The new tab becomes active.',
      newTabSchema.shape,
      async ({ url }) => {
        const result = await createTab(url);
        return handleResult(result);
      }
    );
Behavior4/5

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

With no annotations provided, the description carries full burden and adds valuable behavioral context beyond the basic action: it specifies that the new tab becomes active (important UI state information) and that URL navigation is optional. However, it doesn't mention potential side effects like browser focus changes or tab management implications.

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?

Two concise sentences with zero waste: first states core functionality with optional parameter, second adds crucial behavioral detail. Every word earns its place, and the most important information (opening new tab) is front-loaded.

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

Completeness4/5

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

For a simple single-parameter tool with no annotations and no output schema, the description is reasonably complete: it explains what the tool does, the optional parameter, and key behavioral outcome. However, it could mention what happens if no URL is provided (opens blank tab) for full completeness.

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%, so the schema already fully documents the single optional 'url' parameter. The description adds marginal value by mentioning 'optionally navigating to a URL' but doesn't provide additional semantic context beyond what the schema provides. Baseline 3 is appropriate when schema does the heavy lifting.

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 clearly states the verb ('Open') and resource ('a new browser tab'), with specific scope ('optionally navigating to a URL') and behavioral detail ('The new tab becomes active'). It distinguishes from siblings like 'navigate' (which changes current tab) and 'switch_tab' (which activates existing tab).

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

Usage Guidelines4/5

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

The description provides clear context for when to use this tool (to open new tabs, optionally with URL navigation), but doesn't explicitly state when not to use it or name specific alternatives. It implies differentiation from 'navigate' (changes current tab) and 'switch_tab' (activates existing tab), but lacks explicit exclusion guidance.

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/andytango/puppeteer-mcp'

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