Skip to main content
Glama
livoras

Better Playwright MCP

by livoras

browserNavigateBack

Navigate to the previous page in a browser session, with optional wait time to capture snapshots post-operation, enabling efficient web automation and interaction tracking.

Instructions

返回到上一页

Input Schema

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

Implementation Reference

  • The handler function for the 'browser_navigate_back' tool. It calls goBack on the current tab's page, includes a snapshot in the response, and adds the corresponding Playwright code snippet.
    handle: async (tab, params, response) => {
        await tab.page.goBack();
        response.setIncludeSnapshot();
        response.addCode(`await page.goBack();`);
    },
  • Schema definition for the 'browser_navigate_back' tool, including name, title, description, empty input schema, and readOnly type.
    schema: {
        name: 'browser_navigate_back',
        title: 'Go back',
        description: 'Go back to the previous page',
        inputSchema: z.object({}),
        type: 'readOnly',
    },
  • lib/tools.js:32-49 (registration)
    Registration of all tools, including the navigate tools (which contain 'browser_navigate_back') by spreading the imported navigate array into the allTools export.
    export const allTools = [
        ...common,
        ...console,
        ...dialogs,
        ...evaluate,
        ...files,
        ...form,
        ...install,
        ...keyboard,
        ...navigate,
        ...network,
        ...mouse,
        ...pdf,
        ...screenshot,
        ...snapshot,
        ...tabs,
        ...wait,
    ];
  • MCP tool listing registration: maps internal tools (including 'browser_navigate_back') to MCP tool format using toMcpTool.
    async listTools() {
        return this._tools.map(tool => toMcpTool(tool.schema));
    }
  • MCP tool execution: finds tool by name (e.g., 'browser_navigate_back'), parses arguments, calls the handle function, and serializes the response.
    async callTool(name, rawArguments) {
        const tool = this._tools.find(tool => tool.schema.name === name);
        if (!tool)
            throw new Error(`Tool "${name}" not found`);
        const parsedArguments = tool.schema.inputSchema.parse(rawArguments || {});
        const context = this._context;
        const response = new Response(context, name, parsedArguments);
        context.setRunningTool(name);
        try {
            await tool.handle(context, parsedArguments, response);
            await response.finish();
            this._sessionLog?.logResponse(response);
        }
        catch (error) {
            response.addError(String(error));
        }
        finally {
            context.setRunningTool(undefined);
        }
        return response.serialize();
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the action but lacks details on effects (e.g., whether it waits for page load, handles errors if no history exists, or returns a result). For a navigation tool with zero annotation coverage, this is a significant gap in transparency about how it behaves.

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 a single, efficient sentence ('返回到上一页') that directly states the tool's purpose with zero waste. It is appropriately sized and front-loaded, making it easy to parse quickly without unnecessary elaboration.

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

Completeness2/5

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

Given the tool's complexity (navigation with parameters) and lack of annotations and output schema, the description is incomplete. It doesn't cover behavioral aspects like error handling, return values, or interaction with page state, leaving gaps for an agent to understand how to use it effectively in context.

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 fully documents both parameters (pageId and waitForTimeout). The description adds no additional meaning beyond what the schema provides, such as explaining why pageId is required or how waitForTimeout interacts with navigation. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

The description '返回到上一页' (Return to the previous page) clearly states the action (return/navigate back) and resource (page), making the purpose immediately understandable. It distinguishes from siblings like browserNavigate (forward navigation) and browserNavigateForward (explicit forward), though it doesn't explicitly mention the browser context which is implied by the tool name.

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?

No explicit guidance on when to use this tool versus alternatives is provided. The description doesn't mention prerequisites (e.g., having a page to navigate back from), when not to use it (e.g., if no history exists), or compare it to siblings like browserNavigate (for specific URLs) or browserNavigateForward. Usage is implied but not articulated.

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

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

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