Skip to main content
Glama

navigate_page_history

Navigate back or forward through browser history to automate testing, debugging, or content analysis workflows in Chrome DevTools.

Instructions

Navigates the currently selected page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
navigateYesWhether to navigate back or navigate forward in the selected pages history
timeoutNoMaximum wait time in milliseconds. If set to 0, the default timeout will be used.

Implementation Reference

  • The handler function that performs back or forward navigation on the currently selected page's history using Playwright's goBack/goForward methods, with timeout and error handling.
    handler: async (request, response, context) => {
      const page = context.getSelectedPage();
      const options = {
        timeout: request.params.timeout,
      };
    
      try {
        if (request.params.navigate === 'back') {
          await page.goBack(options);
        } else {
          await page.goForward(options);
        }
      } catch (error) {
        response.appendResponseLine(
          `Unable to navigate ${request.params.navigate} in currently selected page. ${error.message}`,
        );
      }
    
      response.setIncludePages(true);
    },
  • Input schema using Zod: 'navigate' enum ('back' or 'forward') and timeout from timeoutSchema.
    schema: {
      navigate: z
        .enum(['back', 'forward'])
        .describe(
          'Whether to navigate back or navigate forward in the selected pages history',
        ),
      ...timeoutSchema,
    },
  • Full tool definition and export using defineTool, including name 'navigate_page_history', description, annotations, schema, and handler.
    export const navigatePageHistory = defineTool({
      name: 'navigate_page_history',
      description: `Navigates the currently selected page.`,
      annotations: {
        category: ToolCategories.NAVIGATION_AUTOMATION,
        readOnlyHint: false,
      },
      schema: {
        navigate: z
          .enum(['back', 'forward'])
          .describe(
            'Whether to navigate back or navigate forward in the selected pages history',
          ),
        ...timeoutSchema,
      },
      handler: async (request, response, context) => {
        const page = context.getSelectedPage();
        const options = {
          timeout: request.params.timeout,
        };
    
        try {
          if (request.params.navigate === 'back') {
            await page.goBack(options);
          } else {
            await page.goForward(options);
          }
        } catch (error) {
          response.appendResponseLine(
            `Unable to navigate ${request.params.navigate} in currently selected page. ${error.message}`,
          );
        }
    
        response.setIncludePages(true);
      },
    });
Behavior3/5

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

Annotations provide readOnlyHint=false, indicating this is a mutation operation. The description doesn't add behavioral context beyond this - no mention of what gets modified (browser history position), side effects, or error conditions. However, it doesn't contradict annotations, and the simple action is somewhat self-explanatory.

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?

Extremely concise single sentence with zero waste. Every word earns its place - 'navigates' (action), 'currently selected' (context), 'page' (resource). No fluff or redundancy.

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

Completeness3/5

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

For a simple 2-parameter tool with good schema coverage and readOnlyHint annotation, the description is minimally adequate. However, it lacks context about what 'navigate' means (history traversal vs URL navigation) and doesn't mention the timeout parameter's purpose. No output schema exists, so return values are undocumented.

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%, with both parameters well-documented in the schema. The description adds no parameter information beyond what's in the schema. 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.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Navigates the currently selected page' clearly states the verb (navigate) and resource (currently selected page). It distinguishes from sibling 'navigate_page' which likely navigates to a URL rather than through history. However, it doesn't specify the navigation is through page history, which the input schema reveals.

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 guidance on when to use this tool versus alternatives like 'navigate_page' or 'select_page'. The description doesn't mention this is specifically for browser history navigation, nor does it provide context about prerequisites (needing a selected page) or exclusions.

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/SHAY5555-gif/chrome-devtools-mcp'

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