Skip to main content
Glama
livoras

Better Playwright MCP

by livoras

browserNavigate

Directs a web page to a specified URL using a page ID, with optional wait time for snapshot capture, enabling precise browser navigation within automation workflows.

Instructions

导航到指定URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageIdYes页面ID
urlYes要导航的URL
waitForTimeoutNo操作后等待获取快照的延迟时间(毫秒,默认2000)

Implementation Reference

  • Handler function that ensures a tab is open and navigates to the specified URL, includes snapshot in response and adds Playwright code snippet.
    handle: async (context, params, response) => {
        const tab = await context.ensureTab();
        await tab.navigate(params.url);
        response.setIncludeSnapshot();
        response.addCode(`await page.goto('${params.url}');`);
    },
  • Schema definition for the browser_navigate tool including name, title, description, Zod input schema for 'url', and destructive type.
    schema: {
        name: 'browser_navigate',
        title: 'Navigate to a URL',
        description: 'Navigate to a URL',
        inputSchema: z.object({
            url: z.string().describe('The URL to navigate to'),
        }),
        type: 'destructive',
    },
  • lib/tools.js:24-24 (registration)
    Import of the navigate.js module which defines the browser_navigate tool.
    import navigate from './tools/navigate.js';
  • lib/tools.js:41-41 (registration)
    Spreading the navigate tools (including browser_navigate) into the allTools array for global tool registration.
    ...navigate,
  • Initialization of the backend's tools list using filteredTools, which includes browser_navigate, for MCP tool exposure.
    this._tools = filteredTools(config);

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/livoras/better-playwright-mcp'

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