Skip to main content
Glama

navigate_history

Navigate browser history backward or forward to test web application flows, automate navigation sequences, or control browsing direction during automation tasks.

Instructions

Navigate history back/forward. UIDs become stale.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directionYesback or forward

Implementation Reference

  • Handler function that implements the navigate_history tool logic: validates direction ('back' or 'forward'), gets Firefox instance, calls navigateBack() or navigateForward(), and returns success or error response.
    export async function handleNavigateHistory(args: unknown): Promise<McpToolResponse> {
      try {
        const { direction } = args as { direction: 'back' | 'forward' };
    
        if (!direction || (direction !== 'back' && direction !== 'forward')) {
          throw new Error('direction parameter is required and must be "back" or "forward"');
        }
    
        const { getFirefox } = await import('../index.js');
        const firefox = await getFirefox();
    
        if (direction === 'back') {
          await firefox.navigateBack();
        } else {
          await firefox.navigateForward();
        }
    
        return successResponse(`✅ ${direction}`);
      } catch (error) {
        return errorResponse(error as Error);
      }
    }
  • Tool definition object for 'navigate_history' including name, description, and inputSchema for MCP validation (requires 'direction' as 'back' or 'forward').
    export const navigateHistoryTool = {
      name: 'navigate_history',
      description: 'Navigate history back/forward. UIDs become stale.',
      inputSchema: {
        type: 'object',
        properties: {
          direction: {
            type: 'string',
            enum: ['back', 'forward'],
            description: 'back or forward',
          },
        },
        required: ['direction'],
      },
    };
  • src/index.ts:145-145 (registration)
    Registration of the navigate_history handler in the toolHandlers Map used by the MCP server.
    ['navigate_history', tools.handleNavigateHistory],
  • src/index.ts:189-189 (registration)
    Registration of the navigateHistoryTool schema in the allTools array returned by ListToolsRequest.
    tools.navigateHistoryTool,
  • Re-export of navigateHistoryTool and handleNavigateHistory from utilities.ts for central import in src/index.ts.
    navigateHistoryTool,
    setViewportSizeTool,
    handleAcceptDialog,
    handleDismissDialog,
    handleNavigateHistory,
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses a key behavioral trait ('UIDs become stale'), indicating that UIDs may become invalid after navigation, which is useful context. However, it lacks details on side effects, permissions, or response behavior, leaving gaps for a mutation-like tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief and front-loaded with the main action, but the second sentence ('UIDs become stale') adds important context without redundancy. It could be more structured but avoids unnecessary verbosity.

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?

Given no annotations and no output schema, the description is minimal but includes a critical behavioral note ('UIDs become stale'). However, for a navigation tool with potential side effects, it lacks details on what 'navigate history' entails, error conditions, or return values, making it only adequate.

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 the 'direction' parameter with its enum values. The description adds no additional meaning or context about the parameter beyond what the schema provides, meeting the baseline for high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

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

The description states the action ('navigate history back/forward') but is vague about the resource or scope—it's unclear whether this refers to browser history, page navigation, or another context. It doesn't distinguish from sibling tools like 'navigate_page', which suggests similar functionality but for different targets.

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 like 'navigate_page' or 'select_page' is provided. The mention of 'UIDs become stale' hints at a context involving UIDs, but it's not clear how this relates to usage decisions or prerequisites.

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/mozilla/firefox-devtools-mcp'

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