Skip to main content
Glama
cloudflare

Cloudflare Playwright MCP

Official
by cloudflare

browser_navigate_back

Destructive

Go back to the previous page in browsing history. Enables AI assistants to revert to the prior page after navigating forward, supporting multi-step tasks like form submission or link traversal.

Instructions

Go back to the previous page in the history

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for browser_navigate_back. It ensures a tab is available, calls page.goBack() on the Playwright page, and returns code, captureSnapshot, and waitForNetwork: false.
    const goBack: ToolFactory = captureSnapshot => defineTool({
      capability: 'history',
      schema: {
        name: 'browser_navigate_back',
        title: 'Go back',
        description: 'Go back to the previous page',
        inputSchema: z.object({}),
        type: 'readOnly',
      },
    
      handle: async context => {
        const tab = await context.ensureTab();
        await tab.page.goBack();
        const code = [
          `// Navigate back`,
          `await page.goBack();`,
        ];
    
        return {
          code,
          captureSnapshot,
          waitForNetwork: false,
        };
      },
    });
  • Schema definition for browser_navigate_back: name, title, description, empty input schema, and type 'readOnly'.
    schema: {
      name: 'browser_navigate_back',
      title: 'Go back',
      description: 'Go back to the previous page',
      inputSchema: z.object({}),
      type: 'readOnly',
  • The navigate.ts module exports goBack (browser_navigate_back) as part of the default export array, registering it alongside navigate and goForward.
    export default (captureSnapshot: boolean) => [
      navigate(captureSnapshot),
      goBack(captureSnapshot),
      goForward(captureSnapshot),
    ];
  • src/tools.ts:23-50 (registration)
    The navigate module (including browser_navigate_back) is imported in src/tools.ts and spread into the snapshotTools and visionTools arrays.
    import navigate from './tools/navigate.js';
    import network from './tools/network.js';
    import pdf from './tools/pdf.js';
    import snapshot from './tools/snapshot.js';
    import tabs from './tools/tabs.js';
    import screenshot from './tools/screenshot.js';
    import testing from './tools/testing.js';
    import vision from './tools/vision.js';
    import wait from './tools/wait.js';
    
    import type { Tool } from './tools/tool.js';
    
    export const snapshotTools: Tool<any>[] = [
      ...common(true),
      ...console,
      ...dialogs(true),
      ...files(true),
      ...install,
      ...keyboard(true),
      ...navigate(true),
      ...network,
      ...pdf,
      ...screenshot,
      ...snapshot,
      ...tabs(true),
      ...testing,
      ...wait(true),
    ];
  • The defineTool helper function used to create the tool definition, providing type safety.
    export function defineTool<Input extends InputType>(tool: Tool<Input>): Tool<Input> {
      return tool;
    }
Behavior3/5

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

Annotations already indicate destructiveHint=true and readOnlyHint=false, so the description does not need to add much. It adds no extra behavioral context beyond the obvious navigation action.

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?

A single, concise sentence with no unnecessary words. Every part is essential.

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 parameterless action with no output schema, the description is largely complete. It could mention edge cases like empty history, but overall it adequately defines the tool's purpose.

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?

No parameters exist, and schema coverage is 100%. According to rubric, 0 params earns baseline 4. Description adds no parameter info, which 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?

Description clearly states the action 'Go back to the previous page in the history'. It uses a specific verb and resource, and distinguishes from sibling tool browser_navigate which goes to a specific URL.

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

Usage Guidelines3/5

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

No guidance on when to use this tool versus alternatives or when it might fail (e.g., no history). The description is functional but lacks context for appropriate use.

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

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