Skip to content

Chrome DevTools for coding agents

74.6 KB
Raw Blame
/**
 * @license
 * Copyright 2026 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */

/**
 * @file
 * WARNING: This file is auto-generated by 'npm run cli:generate'.
 * Do not edit this file manually.
 */

export interface ArgDef {
  name: string;
  type: string;
  description: string;
  required: boolean;
  /** Whether the arg is a positional on the command line, otherwise a flag. */
  positional: boolean;
  default?: string | number | boolean;
  enum?: ReadonlyArray<string | number>;
}
export type Commands = Record<
  string,
  {
    description: string;
    category: string;
    args: Record<string, ArgDef>;
  }
>;
export const commands: Commands = {
  analyze_heapsnapshot_contexts: {
    description:
      'Loads and caches a memory heapsnapshot to identify and rank closure contexts holding dead captured fields—variables no remaining live closure can read. Scopes are ranked globally by the retained size of these dead values to provide a prioritizing heuristic, rather than an exact measure of reclaimable bytes. (requires flag: --memoryDebugging=true)',
    category: 'Memory',
    args: {
      filePath: {
        name: 'filePath',
        type: 'string',
        description: 'A path to a .heapsnapshot file to read.',
        required: true,
        positional: true,
      },
      retainedSize: {
        name: 'retainedSize',
        type: 'string',
        description:
          'Inclusive range for the dead-field score of a context (e.g. "10KB", "1MB-2MB", "-1MB", or "1MB-"). A single value is treated as a minimum.',
        required: false,
        positional: false,
      },
      scopeInfoNodeId: {
        name: 'scopeInfoNodeId',
        type: 'integer',
        description:
          'Only return contexts declared by the scope with this ScopeInfo node id, as reported in the scope header of a previous call.',
        required: false,
        positional: false,
      },
      maxNameLength: {
        name: 'maxNameLength',
        type: 'integer',
        description:
          'Maximum length of names before truncation. Defaults to 100.',
        required: false,
        positional: false,
      },
      pageIdx: {
        name: 'pageIdx',
        type: 'integer',
        description:
          'The zero-based page index. Defaults to 0 (the first page).',
        required: false,
        positional: false,
        default: 0,
      },
      pageSize: {
        name: 'pageSize',
        type: 'integer',
        description:
          'The maximum number of items to return per page. Defaults to 50.',
        required: false,
        positional: false,
        default: 50,
      },
    },
  },
  click: {
    description: 'Clicks on the provided element',
    category: 'Input automation',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      uid: {
        name: 'uid',
        type: 'string',
        description:
          'The uid of an element on the page from the page content snapshot',
        required: true,
        positional: true,
      },
      dblClick: {
        name: 'dblClick',
        type: 'boolean',
        description: 'Set to true for double clicks. Default is false.',
        required: false,
        positional: false,
      },
      includeSnapshot: {
        name: 'includeSnapshot',
        type: 'boolean',
        description:
          'Whether to include a snapshot in the response. Default is false.',
        required: false,
        positional: false,
      },
    },
  },
  click_at: {
    description:
      'Clicks at the provided coordinates (requires flag: --experimentalVision=true)',
    category: 'Input automation',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      x: {
        name: 'x',
        type: 'number',
        description: 'The x coordinate',
        required: true,
        positional: true,
      },
      y: {
        name: 'y',
        type: 'number',
        description: 'The y coordinate',
        required: true,
        positional: true,
      },
      dblClick: {
        name: 'dblClick',
        type: 'boolean',
        description: 'Set to true for double clicks. Default is false.',
        required: false,
        positional: false,
      },
      includeSnapshot: {
        name: 'includeSnapshot',
        type: 'boolean',
        description:
          'Whether to include a snapshot in the response. Default is false.',
        required: false,
        positional: false,
      },
    },
  },
  close_heapsnapshot: {
    description:
      'Closes a previously loaded and cached memory heapsnapshot, freeing its memory. (requires flag: --memoryDebugging=true)',
    category: 'Memory',
    args: {
      filePath: {
        name: 'filePath',
        type: 'string',
        description: 'A path to the .heapsnapshot file to close.',
        required: true,
        positional: true,
      },
    },
  },
  close_page: {
    description:
      'Closes the page by its index. The last open page cannot be closed.',
    category: 'Navigation automation',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description:
          'The ID of the page to close. Call list_pages to list pages.',
        required: true,
        positional: true,
      },
    },
  },
  compare_heapsnapshots: {
    description:
      'Loads and caches two memory heapsnapshots and returns the comparison. If classIndex is provided, returns detailed diff for that class, otherwise returns summary diff. (requires flag: --memoryDebugging=true)',
    category: 'Memory',
    args: {
      baseFilePath: {
        name: 'baseFilePath',
        type: 'string',
        description:
          'A path to the base .heapsnapshot file (earlier snapshot).',
        required: true,
        positional: true,
      },
      currentFilePath: {
        name: 'currentFilePath',
        type: 'string',
        description:
          'A path to the current .heapsnapshot file (later snapshot).',
        required: true,
        positional: true,
      },
      classIndex: {
        name: 'classIndex',
        type: 'number',
        description:
          'Optional 0-based index of the class in the summary list to filter results, showing individual objects.',
        required: false,
        positional: false,
      },
      maxNameLength: {
        name: 'maxNameLength',
        type: 'integer',
        description:
          'Maximum length of names before truncation. Defaults to 100.',
        required: false,
        positional: false,
      },
      pageIdx: {
        name: 'pageIdx',
        type: 'integer',
        description:
          'The zero-based page index. Defaults to 0 (the first page).',
        required: false,
        positional: false,
        default: 0,
      },
      pageSize: {
        name: 'pageSize',
        type: 'integer',
        description:
          'The maximum number of items to return per page. Defaults to 50.',
        required: false,
        positional: false,
        default: 50,
      },
    },
  },
  configure_webauthn: {
    description:
      'Adds a virtual WebAuthn authenticator to the page. Call this before the page calls navigator.credentials. It answers navigator.credentials.create() and get() and is removed when the page closes. Omitted parameters keep their current values. Changing protocol, transport, hasResidentKey or hasUserVerification replaces the authenticator and deletes its credentials. enabled=false ignores other parameters and removes all authenticators on the page. (requires flag: --categoryWebauthn=true)',
    category: 'WebAuthn',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      enabled: {
        name: 'enabled',
        type: 'boolean',
        description:
          'Set to false to remove all virtual authenticators from the page.',
        required: true,
        positional: true,
      },
      protocol: {
        name: 'protocol',
        type: 'string',
        description: 'The authenticator protocol. Default: ctap2.',
        required: false,
        positional: false,
        enum: ['ctap2', 'u2f'],
      },
      transport: {
        name: 'transport',
        type: 'string',
        description:
          '"internal" is a platform authenticator such as Touch ID or Windows Hello; the others are roaming security keys. Default: internal.',
        required: false,
        positional: false,
        enum: ['internal', 'usb', 'nfc', 'ble', 'hybrid'],
      },
      hasResidentKey: {
        name: 'hasResidentKey',
        type: 'boolean',
        description:
          'Whether the authenticator can store discoverable credentials (passkeys). Default: true. u2f does not support it, so it is false for u2f.',
        required: false,
        positional: false,
      },
      hasUserVerification: {
        name: 'hasUserVerification',
        type: 'boolean',
        description:
          'Whether the authenticator supports user verification (PIN or biometrics). Default: true. u2f does not support it, so it is false for u2f.',
        required: false,
        positional: false,
      },
      isUserVerified: {
        name: 'isUserVerified',
        type: 'boolean',
        description:
          'Whether user verification succeeds. Set to false to test a failed verification. Default: true.',
        required: false,
        positional: false,
      },
    },
  },
  drag: {
    description: 'Drag an element onto another element',
    category: 'Input automation',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      from_uid: {
        name: 'from_uid',
        type: 'string',
        description: 'The uid of the element to drag',
        required: true,
        positional: true,
      },
      to_uid: {
        name: 'to_uid',
        type: 'string',
        description: 'The uid of the element to drop into',
        required: true,
        positional: true,
      },
      includeSnapshot: {
        name: 'includeSnapshot',
        type: 'boolean',
        description:
          'Whether to include a snapshot in the response. Default is false.',
        required: false,
        positional: false,
      },
    },
  },
  emulate: {
    description:
      'Emulates various features on the target page. Each call replaces all emulation settings (except extraHttpHeaders), so pass all desired settings in a single call.',
    category: 'Emulation',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      networkConditions: {
        name: 'networkConditions',
        type: 'string',
        description: 'Throttle network. Omit to disable throttling.',
        required: false,
        positional: false,
        enum: ['Offline', 'Slow 3G', 'Fast 3G', 'Slow 4G', 'Fast 4G'],
      },
      cpuThrottlingRate: {
        name: 'cpuThrottlingRate',
        type: 'number',
        description:
          'Represents the CPU slowdown factor. Omit or set the rate to 1 to disable throttling',
        required: false,
        positional: false,
      },
      geolocation: {
        name: 'geolocation',
        type: 'string',
        description:
          'Geolocation (`<latitude>,<longitude>`) to emulate. Latitude between -90 and 90. Longitude between -180 and 180. Omit to clear the geolocation override.',
        required: false,
        positional: false,
      },
      userAgent: {
        name: 'userAgent',
        type: 'string',
        description:
          'User agent to emulate. Omit or set to empty string to clear the user agent override.',
        required: false,
        positional: false,
      },
      colorScheme: {
        name: 'colorScheme',
        type: 'string',
        description:
          'Emulate the dark or the light mode. Omit or set to "auto" to reset to the default.',
        required: false,
        positional: false,
        enum: ['dark', 'light', 'auto'],
      },
      forcedColors: {
        name: 'forcedColors',
        type: 'string',
        description:
          'Emulate the `forced-colors` CSS media feature. Omit or set to "auto" to reset to the default.',
        required: false,
        positional: false,
        enum: ['active', 'none', 'auto'],
      },
      prefersContrast: {
        name: 'prefersContrast',
        type: 'string',
        description:
          'Emulate the `prefers-contrast` CSS media feature. Omit or set to "auto" to reset to the default.',
        required: false,
        positional: false,
        enum: ['more', 'less', 'custom', 'no-preference', 'auto'],
      },
      prefersReducedMotion: {
        name: 'prefersReducedMotion',
        type: 'string',
        description:
          'Emulate the `prefers-reduced-motion` CSS media feature. Omit or set to "auto" to reset to the default.',
        required: false,
        positional: false,
        enum: ['reduce', 'no-preference', 'auto'],
      },
      viewport: {
        name: 'viewport',
        type: 'string',
        description:
          "Emulate device viewports '<width>x<height>x<devicePixelRatio>[,mobile][,touch][,landscape]'. 'touch' and 'mobile' to emulate mobile devices. 'landscape' to emulate landscape mode. Omit to clear the viewport override.",
        required: false,
        positional: false,
      },
      extraHttpHeaders: {
        name: 'extraHttpHeaders',
        type: 'string',
        description:
          'Extra HTTP headers as a JSON string object, e.g. {"X-Custom": "value", "Authorization": "Bearer token"}. Headers are included into every HTTP request originating from the page and persist across navigations until cleared. Pass an empty string to clear all extra headers.',
        required: false,
        positional: false,
      },
    },
  },
  evaluate_script: {
    description:
      'Evaluate JavaScript inside the target page or service worker. The source can be provided inline or loaded from a local file. Returns the response as JSON, so returned values have to be JSON-serializable.',
    category: 'Debugging',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description:
          'Targets a specific page by ID. Required when not evaluating in a service worker.',
        required: false,
        positional: false,
      },
      function: {
        name: 'function',
        type: 'string',
        description:
          'JavaScript source to execute in the target page. Provide either this or sourcePath, but not both. The source is interpreted according to format.\nExample without arguments: `() => document.title` or `async () => await fetch("example.com")`.\nExample with arguments: `(el) => el.innerText`\n',
        required: false,
        positional: true,
      },
      sourcePath: {
        name: 'sourcePath',
        type: 'string',
        description:
          "The absolute or relative path to a JavaScript file on the MCP server's local filesystem. Provide either this or function, but not both.",
        required: false,
        positional: false,
      },
      format: {
        name: 'format',
        type: 'string',
        description:
          'How to interpret the source. "function" treats it as a function declaration and supports args. "script" evaluates it as classic JavaScript and does not support args. Defaults to "function". ECMAScript modules are not supported.',
        required: false,
        positional: false,
        enum: ['function', 'script'],
      },
      args: {
        name: 'args',
        type: 'array',
        description:
          'An optional list of arguments (element uids from the page content snapshot) to pass to the function.',
        required: false,
        positional: false,
      },
      filePath: {
        name: 'filePath',
        type: 'string',
        description:
          'The absolute or relative path to a file to save the script output to. If omitted, the output is returned inline.',
        required: false,
        positional: false,
      },
      dialogAction: {
        name: 'dialogAction',
        type: 'string',
        description:
          'Handle dialogs while execution. "accept", "dismiss", or string for response of window.prompt. Defaults to accept.',
        required: false,
        positional: false,
      },
      waitForStableDom: {
        name: 'waitForStableDom',
        type: 'boolean',
        description:
          'Whether to wait for the DOM to settle. Pass false if the script only reads data. Defaults to true.',
        required: false,
        positional: false,
      },
      serviceWorkerId: {
        name: 'serviceWorkerId',
        type: 'string',
        description:
          "The optional service worker id to evaluate the script in. If provided, 'pageId' should be omitted. Note: 'args' (element UIDs) cannot be used when evaluating in a service worker.",
        required: false,
        positional: false,
      },
    },
  },
  execute_3p_developer_tool: {
    description:
      'Executes a third-party developer tool exposed by the page. (requires flag: --categoryExperimentalThirdParty=true)',
    category: 'Third-party',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      toolName: {
        name: 'toolName',
        type: 'string',
        description: 'The name of the tool to execute',
        required: true,
        positional: true,
      },
      params: {
        name: 'params',
        type: 'string',
        description: 'The JSON-stringified parameters to pass to the tool',
        required: false,
        positional: false,
      },
    },
  },
  execute_webmcp_tool: {
    description:
      "Executes a WebMCP tool exposed by the page (for debugging tools, use 'execute_3p_developer_tool'). (requires flag: --categoryExperimentalWebmcp=true)",
    category: 'WebMCP',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      toolName: {
        name: 'toolName',
        type: 'string',
        description: 'The name of the WebMCP tool to execute',
        required: true,
        positional: true,
      },
      input: {
        name: 'input',
        type: 'string',
        description:
          'The JSON-stringified parameters to pass to the WebMCP tool',
        required: false,
        positional: false,
      },
    },
  },
  fill: {
    description:
      'Type text into an input, text area or select an option from a <select> element.',
    category: 'Input automation',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      uid: {
        name: 'uid',
        type: 'string',
        description:
          'The uid of an element on the page from the page content snapshot',
        required: true,
        positional: true,
      },
      value: {
        name: 'value',
        type: 'string',
        description:
          'The value to fill in. "true" or "false" for checkboxes and toggles, "true" for radio buttons.',
        required: true,
        positional: true,
      },
      includeSnapshot: {
        name: 'includeSnapshot',
        type: 'boolean',
        description:
          'Whether to include a snapshot in the response. Default is false.',
        required: false,
        positional: false,
      },
    },
  },
  get_console_message: {
    description:
      'Gets a console message by its ID. You can get all messages by calling list_console_messages.',
    category: 'Debugging',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      msgid: {
        name: 'msgid',
        type: 'number',
        description:
          'The msgid of a console message on the page from the listed console messages',
        required: true,
        positional: true,
      },
    },
  },
  get_css_styles: {
    description:
      'Retrieve matched CSS rules, inline styles (element.style), inherited styles, custom properties, and cascade wrappers (@layer, @media, @container, @scope) for an element identified by its UID.\nRules are ordered from highest to lowest cascade precedence and include source line numbers (e.g. index:196). Active (winning) declarations have no prefix tag, while (losing) overridden declarations are prefixed with [overloaded]. Declarations referencing custom properties via var() include their resolved values as inline comments (e.g. color: var(--brand); /* #ff0000 */).\nTreat the output as authoritative and complete.\nResults are paginated (10 rules per page by default); use pageIdx to page through the remaining rules. Requires a UID from take_snapshot.',
    category: 'Debugging',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      uid: {
        name: 'uid',
        type: 'string',
        description:
          'The uid of the element on the page from the page content snapshot to inspect CSS styles for',
        required: true,
        positional: true,
      },
      pageSize: {
        name: 'pageSize',
        type: 'integer',
        description:
          'Maximum number of CSS rules to return per page. Defaults to 10.',
        required: false,
        positional: false,
        default: 10,
      },
      pageIdx: {
        name: 'pageIdx',
        type: 'integer',
        description:
          'Page number to return (0-based). Defaults to 0 (the first page).',
        required: false,
        positional: false,
        default: 0,
      },
    },
  },
  get_heapsnapshot_class_nodes: {
    description:
      'Loads and caches a memory heapsnapshot and returns instances of a specific class with their IDs. (requires flag: --memoryDebugging=true)',
    category: 'Memory',
    args: {
      filePath: {
        name: 'filePath',
        type: 'string',
        description: 'A path to a .heapsnapshot file to read.',
        required: true,
        positional: true,
      },
      id: {
        name: 'id',
        type: 'number',
        description: 'The ID for the class, obtained from details.',
        required: true,
        positional: true,
      },
      filterName: {
        name: 'filterName',
        type: 'string',
        description: 'An optional filter to apply to the nodes.',
        required: false,
        positional: false,
        enum: [
          'objectsRetainedByDetachedDomNodes',
          'objectsRetainedByConsole',
          'objectsRetainedByEventHandlers',
          'objectsRetainedByContexts',
          'sharedNativeContext',
          'noNativeContext',
          'attributedToSpecificNativeContext',
        ],
      },
      objectId: {
        name: 'objectId',
        type: 'number',
        description:
          'The object ID (nodeId) of the specific native context to filter by when filterName is attributedToSpecificNativeContext.',
        required: false,
        positional: false,
      },
      maxNameLength: {
        name: 'maxNameLength',
        type: 'integer',
        description:
          'Maximum length of names before truncation. Defaults to 100.',
        required: false,
        positional: false,
      },
      pageIdx: {
        name: 'pageIdx',
        type: 'integer',
        description:
          'The zero-based page index. Defaults to 0 (the first page).',
        required: false,
        positional: false,
        default: 0,
      },
      pageSize: {
        name: 'pageSize',
        type: 'integer',
        description:
          'The maximum number of items to return per page. Defaults to 50.',
        required: false,
        positional: false,
        default: 50,
      },
    },
  },
  get_heapsnapshot_details: {
    description:
      'Loads and caches a memory heapsnapshot and returns all available information including statistics, static data, and aggregated node information. Supports pagination for aggregates. (requires flag: --memoryDebugging=true)',
    category: 'Memory',
    args: {
      filePath: {
        name: 'filePath',
        type: 'string',
        description: 'A path to a .heapsnapshot file to read.',
        required: true,
        positional: true,
      },
      filterName: {
        name: 'filterName',
        type: 'string',
        description: 'An optional filter to apply to the aggregates.',
        required: false,
        positional: false,
        enum: [
          'objectsRetainedByDetachedDomNodes',
          'objectsRetainedByConsole',
          'objectsRetainedByEventHandlers',
          'objectsRetainedByContexts',
          'sharedNativeContext',
          'noNativeContext',
          'attributedToSpecificNativeContext',
        ],
      },
      objectId: {
        name: 'objectId',
        type: 'number',
        description:
          'The object ID (nodeId) of the specific native context to filter by when filterName is attributedToSpecificNativeContext.',
        required: false,
        positional: false,
      },
      maxNameLength: {
        name: 'maxNameLength',
        type: 'integer',
        description:
          'Maximum length of names before truncation. Defaults to 100.',
        required: false,
        positional: false,
      },
      pageIdx: {
        name: 'pageIdx',
        type: 'integer',
        description:
          'The zero-based page index. Defaults to 0 (the first page).',
        required: false,
        positional: false,
        default: 0,
      },
      pageSize: {
        name: 'pageSize',
        type: 'integer',
        description:
          'The maximum number of items to return per page. Defaults to 50.',
        required: false,
        positional: false,
        default: 50,
      },
    },
  },
  get_heapsnapshot_dominators: {
    description:
      'Loads and caches a memory heapsnapshot and returns the dominator chain for a specific node ID. This helps to identify which objects are keeping the target node alive. (requires flag: --memoryDebugging=true)',
    category: 'Memory',
    args: {
      filePath: {
        name: 'filePath',
        type: 'string',
        description: 'A path to a .heapsnapshot file to read.',
        required: true,
        positional: true,
      },
      nodeId: {
        name: 'nodeId',
        type: 'number',
        description: 'The node ID to get the dominator chain for.',
        required: true,
        positional: true,
      },
      maxNameLength: {
        name: 'maxNameLength',
        type: 'integer',
        description:
          'Maximum length of names before truncation. Defaults to 100.',
        required: false,
        positional: false,
      },
    },
  },
  get_heapsnapshot_duplicate_strings: {
    description:
      'Loads and caches a memory heapsnapshot and returns duplicate strings grouped by their value. (requires flag: --memoryDebugging=true)',
    category: 'Memory',
    args: {
      filePath: {
        name: 'filePath',
        type: 'string',
        description: 'A path to a .heapsnapshot file to read.',
        required: true,
        positional: true,
      },
      pageIdx: {
        name: 'pageIdx',
        type: 'integer',
        description:
          'The zero-based page index. Defaults to 0 (the first page).',
        required: false,
        positional: false,
        default: 0,
      },
      pageSize: {
        name: 'pageSize',
        type: 'integer',
        description:
          'The maximum number of items to return per page. Defaults to 50.',
        required: false,
        positional: false,
        default: 50,
      },
      maxNameLength: {
        name: 'maxNameLength',
        type: 'integer',
        description:
          'Maximum length of names before truncation. Defaults to 100.',
        required: false,
        positional: false,
      },
    },
  },
  get_heapsnapshot_edges: {
    description:
      'Loads and caches a memory heapsnapshot and returns outgoing edges (references) for a specific node ID. (requires flag: --memoryDebugging=true)',
    category: 'Memory',
    args: {
      filePath: {
        name: 'filePath',
        type: 'string',
        description: 'A path to a .heapsnapshot file to read.',
        required: true,
        positional: true,
      },
      nodeId: {
        name: 'nodeId',
        type: 'number',
        description: 'The node ID to get outgoing edges for.',
        required: true,
        positional: true,
      },
      sortBy: {
        name: 'sortBy',
        type: 'string',
        description: 'Sort order for edges. Default is retainedSize.',
        required: false,
        positional: false,
        enum: ['retainedSize', 'selfSize', 'name'],
      },
      retainedSize: {
        name: 'retainedSize',
        type: 'string',
        description:
          'Inclusive retained size range (e.g. "1MB-2MB", "-1MB", or "1MB-") for target nodes. A single value is treated as a minimum. Currently, only the lower bound is applied.',
        required: false,
        positional: false,
      },
      excludePrimitives: {
        name: 'excludePrimitives',
        type: 'boolean',
        description:
          'Whether to exclude primitive target nodes. Default is true.',
        required: false,
        positional: false,
      },
      maxNameLength: {
        name: 'maxNameLength',
        type: 'integer',
        description:
          'Maximum length of names before truncation. Defaults to 100.',
        required: false,
        positional: false,
      },
      pageIdx: {
        name: 'pageIdx',
        type: 'integer',
        description:
          'The zero-based page index. Defaults to 0 (the first page).',
        required: false,
        positional: false,
        default: 0,
      },
      pageSize: {
        name: 'pageSize',
        type: 'integer',
        description:
          'The maximum number of items to return per page. Defaults to 50.',
        required: false,
        positional: false,
        default: 50,
      },
    },
  },
  get_heapsnapshot_object_details: {
    description:
      'Loads and caches a memory heapsnapshot and returns detailed information about a specific object by its node ID, including size, type, distance, and DOM detachedness. (requires flag: --memoryDebugging=true)',
    category: 'Memory',
    args: {
      filePath: {
        name: 'filePath',
        type: 'string',
        description: 'A path to a .heapsnapshot file to read.',
        required: true,
        positional: true,
      },
      nodeId: {
        name: 'nodeId',
        type: 'number',
        description: 'The node ID to get object details for.',
        required: true,
        positional: true,
      },
      maxNameLength: {
        name: 'maxNameLength',
        type: 'integer',
        description:
          'Maximum length of names before truncation. Defaults to 100.',
        required: false,
        positional: false,
      },
    },
  },
  get_heapsnapshot_retainers: {
    description:
      'Loads and caches a memory heapsnapshot and returns retainers for a specific node ID. (requires flag: --memoryDebugging=true)',
    category: 'Memory',
    args: {
      filePath: {
        name: 'filePath',
        type: 'string',
        description: 'A path to a .heapsnapshot file to read.',
        required: true,
        positional: true,
      },
      nodeId: {
        name: 'nodeId',
        type: 'number',
        description: 'The node ID to get retainers for.',
        required: true,
        positional: true,
      },
      maxNameLength: {
        name: 'maxNameLength',
        type: 'integer',
        description:
          'Maximum length of names before truncation. Defaults to 100.',
        required: false,
        positional: false,
      },
      pageIdx: {
        name: 'pageIdx',
        type: 'integer',
        description:
          'The zero-based page index. Defaults to 0 (the first page).',
        required: false,
        positional: false,
        default: 0,
      },
      pageSize: {
        name: 'pageSize',
        type: 'integer',
        description:
          'The maximum number of items to return per page. Defaults to 50.',
        required: false,
        positional: false,
        default: 50,
      },
    },
  },
  get_heapsnapshot_retaining_paths: {
    description:
      'Loads and caches a memory heapsnapshot and returns retaining paths for a specific node ID. This helps to understand why a node is not being garbage collected. (requires flag: --memoryDebugging=true)',
    category: 'Memory',
    args: {
      filePath: {
        name: 'filePath',
        type: 'string',
        description: 'A path to a .heapsnapshot file to read.',
        required: true,
        positional: true,
      },
      nodeId: {
        name: 'nodeId',
        type: 'number',
        description: 'The node ID to get retaining paths for.',
        required: true,
        positional: true,
      },
      maxDepth: {
        name: 'maxDepth',
        type: 'number',
        description: 'The maximum depth to search for retaining paths.',
        required: false,
        positional: false,
      },
      maxNodes: {
        name: 'maxNodes',
        type: 'number',
        description: 'The maximum number of nodes to return.',
        required: false,
        positional: false,
      },
      maxSiblings: {
        name: 'maxSiblings',
        type: 'number',
        description: 'The maximum number of siblings to return.',
        required: false,
        positional: false,
      },
      maxNameLength: {
        name: 'maxNameLength',
        type: 'integer',
        description:
          'Maximum length of names before truncation. Defaults to 100.',
        required: false,
        positional: false,
      },
    },
  },
  get_heapsnapshot_summary: {
    description:
      'Loads and caches a memory heapsnapshot and returns snapshot summary stats, including native contexts and their sizes, and retained by context summary. (requires flag: --memoryDebugging=true)',
    category: 'Memory',
    args: {
      filePath: {
        name: 'filePath',
        type: 'string',
        description: 'A path to a .heapsnapshot file to read.',
        required: true,
        positional: true,
      },
      maxNameLength: {
        name: 'maxNameLength',
        type: 'integer',
        description:
          'Maximum length of names before truncation. Defaults to 100.',
        required: false,
        positional: false,
      },
    },
  },
  get_network_request: {
    description:
      "Gets a network request by an optional reqid, if omitted returns the currently selected request in the DevTools Network panel. Useful for inspecting request headers (including 'Cookie') and response headers (including 'Set-Cookie' and directives).",
    category: 'Network',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      reqid: {
        name: 'reqid',
        type: 'number',
        description:
          'The reqid of the network request. If omitted returns the currently selected request in the DevTools Network panel.',
        required: false,
        positional: false,
      },
      requestFilePath: {
        name: 'requestFilePath',
        type: 'string',
        description:
          'The absolute or relative path to a .network-request file to save the request body to. If omitted, the body is returned inline.',
        required: false,
        positional: false,
      },
      responseFilePath: {
        name: 'responseFilePath',
        type: 'string',
        description:
          'The absolute or relative path to a .network-response file to save the response body to. If omitted, the body is returned inline.',
        required: false,
        positional: false,
      },
    },
  },
  get_os_app_state: {
    description:
      'Returns the OS integration state (badge count and registered file handlers) for an installed web app, identified by its manifest ID. (requires flag: --categoryPwa=true)',
    category: 'Progressive Web Apps',
    args: {
      manifestId: {
        name: 'manifestId',
        type: 'string',
        description:
          'The manifest ID of the web app: the resolved `id` member of its manifest. If `id` is omitted, it defaults to the resolved `start_url` (e.g. "https://example.com/"). See https://w3c.github.io/manifest/#id-member.',
        required: true,
        positional: true,
      },
    },
  },
  handle_dialog: {
    description:
      'If a browser dialog was opened, use this command to handle it',
    category: 'Input automation',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      action: {
        name: 'action',
        type: 'string',
        description: 'Whether to dismiss or accept the dialog',
        required: true,
        positional: true,
        enum: ['accept', 'dismiss'],
      },
      promptText: {
        name: 'promptText',
        type: 'string',
        description: 'Optional prompt text to enter into the dialog.',
        required: false,
        positional: false,
      },
    },
  },
  hover: {
    description: 'Hover over the provided element',
    category: 'Input automation',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      uid: {
        name: 'uid',
        type: 'string',
        description:
          'The uid of an element on the page from the page content snapshot',
        required: true,
        positional: true,
      },
      includeSnapshot: {
        name: 'includeSnapshot',
        type: 'boolean',
        description:
          'Whether to include a snapshot in the response. Default is false.',
        required: false,
        positional: false,
      },
    },
  },
  install_extension: {
    description:
      'Installs a Chrome extension from the given path. (requires flag: --categoryExtensions=true)',
    category: 'Extensions',
    args: {
      path: {
        name: 'path',
        type: 'string',
        description: 'Absolute path to the unpacked extension folder.',
        required: true,
        positional: true,
      },
    },
  },
  install_pwa: {
    description:
      'Installs a Progressive Web App (PWA) identified by its manifest ID. This installs through the PWA CDP domain without a user gesture or install dialog. DevTools installs default to browser display mode. (requires flag: --categoryPwa=true)',
    category: 'Progressive Web Apps',
    args: {
      manifestId: {
        name: 'manifestId',
        type: 'string',
        description:
          'The manifest ID of the web app: the resolved `id` member of its manifest. If `id` is omitted, it defaults to the resolved `start_url` (e.g. "https://example.com/"). See https://w3c.github.io/manifest/#id-member.',
        required: true,
        positional: true,
      },
      installUrlOrBundleUrl: {
        name: 'installUrlOrBundleUrl',
        type: 'string',
        description:
          'The location of the app or bundle. For a normal site this is the page URL; for an Isolated Web App it can be a file:// or http(s):// signed web bundle.',
        required: true,
        positional: true,
      },
      displayMode: {
        name: 'displayMode',
        type: 'string',
        description:
          'Optional user display mode preference applied after install. "standalone" opens the app in its own window; "browser" opens it as a tab. Installs via the PWA CDP domain default to "browser" because they do not simulate the install dialog, so pass "standalone" to get an app-window experience.',
        required: false,
        positional: false,
        enum: ['standalone', 'browser'],
      },
    },
  },
  launch_pwa: {
    description:
      'Launches an installed Progressive Web App using its saved display mode. Optionally opens a specific URL within the same app instead of the default start URL. (requires flag: --categoryPwa=true)',
    category: 'Progressive Web Apps',
    args: {
      manifestId: {
        name: 'manifestId',
        type: 'string',
        description:
          'The manifest ID of the web app: the resolved `id` member of its manifest. If `id` is omitted, it defaults to the resolved `start_url` (e.g. "https://example.com/"). See https://w3c.github.io/manifest/#id-member.',
        required: true,
        positional: true,
      },
      url: {
        name: 'url',
        type: 'string',
        description:
          'Optional URL within the app to open instead of the default start URL.',
        required: false,
        positional: false,
      },
    },
  },
  lighthouse_audit: {
    description:
      'Get Lighthouse scores, failing audits, and the DOM nodes they flag for accessibility, SEO, best practices, and agentic browsing. Full reports are saved to disk. This excludes performance. For performance audits, run performance_start_trace',
    category: 'Debugging',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      mode: {
        name: 'mode',
        type: 'string',
        description:
          '"navigation" reloads & audits. "snapshot" analyzes current state.',
        required: false,
        positional: false,
        default: 'navigation',
        enum: ['navigation', 'snapshot'],
      },
      device: {
        name: 'device',
        type: 'string',
        description: 'Device to emulate.',
        required: false,
        positional: false,
        default: 'desktop',
        enum: ['desktop', 'mobile'],
      },
      outputDirPath: {
        name: 'outputDirPath',
        type: 'string',
        description: 'Directory for reports. If omitted, uses temporary files.',
        required: false,
        positional: false,
      },
    },
  },
  list_3p_developer_tools: {
    description:
      "Lists all third-party developer tools the page exposes for providing runtime information (including debugging WebMCP tools and tools exposed via the 'devtoolstooldiscovery' event).\nThird-party developer tools can be called via the 'execute_3p_developer_tool()' MCP tool.\nAlternatively, third-party developer tools exposed via the 'devtoolstooldiscovery' event can be executed by calling 'evaluate_script' and adding the\nfollowing command to the script:\n`window.__dtmcp.executeTool(toolName, params)`\nThis might be helpful when the third-party developer tools return non-serializable values or when composing\nthird-party developer tools with additional functionality. (requires flag: --categoryExperimentalThirdParty=true)",
    category: 'Third-party',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
    },
  },
  list_console_messages: {
    description:
      'List all console messages for the target page since the last navigation. This includes console messages originating from extensions content scripts.',
    category: 'Debugging',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      pageSize: {
        name: 'pageSize',
        type: 'integer',
        description:
          'Maximum number of messages to return. When omitted, returns all messages.',
        required: false,
        positional: false,
      },
      pageIdx: {
        name: 'pageIdx',
        type: 'integer',
        description:
          'Page number to return (0-based). When omitted, returns the first page. Ignored unless pageSize is set.',
        required: false,
        positional: false,
      },
      types: {
        name: 'types',
        type: 'array',
        description:
          'Filter messages to only return messages of the specified resource types. When omitted or empty, returns all messages.',
        required: false,
        positional: false,
      },
      includePreservedMessages: {
        name: 'includePreservedMessages',
        type: 'boolean',
        description:
          'Set to true to return the preserved messages over the last 3 navigations.',
        required: false,
        positional: false,
        default: false,
      },
      includeStackTraces: {
        name: 'includeStackTraces',
        type: 'boolean',
        description:
          'Set to true to include the stack trace for each message when available. Increases the response size.',
        required: false,
        positional: false,
        default: false,
      },
      serviceWorkerId: {
        name: 'serviceWorkerId',
        type: 'string',
        description:
          'Filter messages by the service worker ID shown by list_pages (sw-N).',
        required: false,
        positional: false,
      },
    },
  },
  list_extensions: {
    description:
      'Lists the unpacked Chrome extensions loaded in the browser. This includes their name, ID, version, and enabled status. Extensions installed from the Chrome Web Store are not included. (requires flag: --categoryExtensions=true)',
    category: 'Extensions',
    args: {},
  },
  list_network_requests: {
    description:
      'Lists the most recent requests for the target page since the last navigation.',
    category: 'Network',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      pageSize: {
        name: 'pageSize',
        type: 'integer',
        description:
          'Maximum number of requests to return. When omitted, returns all requests.',
        required: false,
        positional: false,
      },
      pageIdx: {
        name: 'pageIdx',
        type: 'integer',
        description:
          'Page number to return (0-based). When omitted, returns the first page. Ignored unless pageSize is set.',
        required: false,
        positional: false,
      },
      resourceTypes: {
        name: 'resourceTypes',
        type: 'array',
        description:
          'Filter requests to only return requests of the specified resource types. When omitted or empty, returns all requests.',
        required: false,
        positional: false,
      },
      includePreservedRequests: {
        name: 'includePreservedRequests',
        type: 'boolean',
        description:
          'Set to true to return the preserved requests over the last 3 navigations.',
        required: false,
        positional: false,
        default: false,
      },
    },
  },
  list_pages: {
    description:
      'Get a list of pages including extension service workers open in the browser.',
    category: 'Navigation automation',
    args: {},
  },
  list_webmcp_tools: {
    description:
      "Lists all WebMCP tools the page exposes (excluding debugging tools, which are exposed via 'list_3p_developer_tools'). (requires flag: --categoryExperimentalWebmcp=true)",
    category: 'WebMCP',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
    },
  },
  mock_network: {
    description:
      'Inspect or update network mocks for a page. With no actions, list mocks matching the supplied filters, or all mocks when no filters are given. Providing abort (including false), allowOrigin, body, or upstream updates the exact route/resourceType pair; omitted actions keep existing settings. Remove and recreate a mock to clear its source or allowOrigin. An omitted route matches any URL. Other mocks are preserved. abort=true suppresses its response and allowOrigin header. The most recently updated matching mock wins and persists across navigations. Configure before navigating or reloading; inspection shows hit counts and replacement errors. allowOrigin requires a body or upstream source. Upstream responses use server-side GET/HEAD fetches. Changes are rejected during a performance trace. Mocks disable the page HTTP cache and intercept every request, affecting measurements. Service workers can bypass mocks. Use remove_network_mock to remove mocks. (requires flag: --categoryNetworkMocks=true)',
    category: 'Network mocks',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      route: {
        name: 'route',
        type: 'string',
        description:
          'Absolute URLPattern, e.g. https://example.com/app.js or `*://*:*/app.js`. Use `*` for wildcards; omitted query strings match any query. Regex and `:name` groups are rejected. Inspection and removal compare the stored pattern exactly. Omit to inspect/remove all routes or match any URL.',
        required: false,
        positional: false,
      },
      resourceType: {
        name: 'resourceType',
        type: 'string',
        description:
          'Restrict requests and stored mock filters to this resource type. Omit to inspect/remove all types or configure a mock for any type.',
        required: false,
        positional: false,
        enum: [
          'document',
          'stylesheet',
          'image',
          'media',
          'font',
          'script',
          'texttrack',
          'xhr',
          'fetch',
          'prefetch',
          'eventsource',
          'manifest',
          'signedexchange',
          'ping',
          'cspviolationreport',
          'preflight',
          'fedcm',
          'other',
        ],
      },
      abort: {
        name: 'abort',
        type: 'boolean',
        description:
          'Abort matching requests when true. When false, use the stored body or upstream source, or send the request to the network if neither is set. A mock without a source still wins over older matching mocks. Abortion takes precedence over body, upstream, and allowOrigin.',
        required: false,
        positional: false,
      },
      allowOrigin: {
        name: 'allowOrigin',
        type: 'string',
        description:
          'Set the Access-Control-Allow-Origin response header to `*`, `null`, or a serialized origin such as https://example.com. Requires body or upstream, either supplied now or already set on the mock. This does not configure preflight or credential headers.',
        required: false,
        positional: false,
      },
      body: {
        name: 'body',
        type: 'string',
        description:
          'Local response body file, revalidated and reread for every request. Content-Type follows its extension. Mutually exclusive with upstream.',
        required: false,
        positional: false,
      },
      upstream: {
        name: 'upstream',
        type: 'string',
        description:
          'Absolute HTTP(S) replacement URL for GET/HEAD requests. URL allowlists and blocklists apply to this URL and every redirect. Mutually exclusive with body.',
        required: false,
        positional: false,
      },
    },
  },
  navigate_page: {
    description:
      'Go to a URL, or back, forward, or reload. Use project URL if not specified otherwise.',
    category: 'Navigation automation',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      type: {
        name: 'type',
        type: 'string',
        description:
          'Navigate the page by URL, back or forward in history, or reload.',
        required: false,
        positional: false,
        enum: ['url', 'back', 'forward', 'reload'],
      },
      url: {
        name: 'url',
        type: 'string',
        description: 'Target URL (only type=url)',
        required: false,
        positional: false,
      },
      ignoreCache: {
        name: 'ignoreCache',
        type: 'boolean',
        description: 'Whether to ignore cache on reload.',
        required: false,
        positional: false,
      },
      handleBeforeUnload: {
        name: 'handleBeforeUnload',
        type: 'string',
        description:
          'Whether to auto accept or beforeunload dialogs triggered by this navigation. Default is accept.',
        required: false,
        positional: false,
        enum: ['accept', 'dismiss'],
      },
      initScript: {
        name: 'initScript',
        type: 'string',
        description:
          'A JavaScript script to be executed on each new document before any other scripts for the next navigation.',
        required: false,
        positional: false,
      },
      timeout: {
        name: 'timeout',
        type: 'integer',
        description:
          'Maximum wait time in milliseconds. If set to 0, the default timeout will be used.',
        required: false,
        positional: false,
      },
    },
  },
  new_page: {
    description:
      'Open a new tab and load a URL. Use project URL if not specified otherwise.',
    category: 'Navigation automation',
    args: {
      url: {
        name: 'url',
        type: 'string',
        description: 'URL to load in a new page.',
        required: true,
        positional: true,
      },
      background: {
        name: 'background',
        type: 'boolean',
        description:
          'Whether to open the page in the background without bringing it to the front. Default is false (foreground).',
        required: false,
        positional: false,
      },
      isolatedContext: {
        name: 'isolatedContext',
        type: 'string',
        description:
          'If specified, the page is created in an isolated browser context with the given name. Pages in the same browser context share cookies and storage. Pages in different browser contexts are fully isolated (useful for clean-slate testing of cookies and authentication).',
        required: false,
        positional: false,
      },
      timeout: {
        name: 'timeout',
        type: 'integer',
        description:
          'Maximum wait time in milliseconds. If set to 0, the default timeout will be used.',
        required: false,
        positional: false,
      },
    },
  },
  performance_analyze_insight: {
    description:
      'Provides more detailed information on a specific Performance Insight of an insight set that was highlighted in the results of a trace recording.',
    category: 'Performance',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      insightSetId: {
        name: 'insightSetId',
        type: 'string',
        description:
          'The id for the specific insight set. Only use the ids given in the "Available insight sets" list.',
        required: true,
        positional: true,
      },
      insightName: {
        name: 'insightName',
        type: 'string',
        description:
          'The name of the Insight you want more information on. For example: "DocumentLatency" or "LCPBreakdown"',
        required: true,
        positional: true,
      },
    },
  },
  performance_start_trace: {
    description:
      'Start a performance trace on the target webpage. Use to find frontend performance issues, Core Web Vitals (LCP, INP, CLS), and improve page load speed.',
    category: 'Performance',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      reload: {
        name: 'reload',
        type: 'boolean',
        description:
          'Determines if, once tracing has started, the target page should be automatically reloaded. Navigate the page to the right URL using the navigate_page tool BEFORE starting the trace if reload or autoStop is set to true.',
        required: false,
        positional: false,
        default: true,
      },
      autoStop: {
        name: 'autoStop',
        type: 'boolean',
        description:
          'Determines if the trace recording should be automatically stopped.',
        required: false,
        positional: false,
        default: true,
      },
      ignoreCache: {
        name: 'ignoreCache',
        type: 'boolean',
        description:
          'Whether to bypass the HTTP cache when reloading the page, to measure a cold page load. Only applies if reload is true. Active network mocks always disable the page HTTP cache.',
        required: false,
        positional: false,
      },
      filePath: {
        name: 'filePath',
        type: 'string',
        description:
          'The absolute file path, or a file path relative to the current working directory, to save the raw trace data. For example, trace.json.gz (compressed) or trace.json (uncompressed).',
        required: false,
        positional: false,
      },
    },
  },
  performance_stop_trace: {
    description:
      'Stop the active performance trace recording on the target webpage.',
    category: 'Performance',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      filePath: {
        name: 'filePath',
        type: 'string',
        description:
          'The absolute file path, or a file path relative to the current working directory, to save the raw trace data. For example, trace.json.gz (compressed) or trace.json (uncompressed).',
        required: false,
        positional: false,
      },
    },
  },
  press_key: {
    description:
      'Press a key or key combination. Use this when other input methods like fill() cannot be used (e.g., keyboard shortcuts, navigation keys, or special key combinations). Note: On macOS, native <select> elements cannot be operated with ArrowDown/Enter via press_key; use fill() on the combobox or click() on the option instead.',
    category: 'Input automation',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      key: {
        name: 'key',
        type: 'string',
        description:
          'A key or a combination (e.g., "Enter", "Control+A", "Control++", "Control+Shift+R"). Modifiers: Control, Shift, Alt, Meta',
        required: true,
        positional: true,
      },
      includeSnapshot: {
        name: 'includeSnapshot',
        type: 'boolean',
        description:
          'Whether to include a snapshot in the response. Default is false.',
        required: false,
        positional: false,
      },
    },
  },
  query_heapsnapshot_objects: {
    description:
      'Loads and caches a memory heapsnapshot and queries objects matching specific filters (className, propertyName, nodeType, retainedSize, selfSize, isDetached, sortBy). (requires flag: --memoryDebugging=true)',
    category: 'Memory',
    args: {
      filePath: {
        name: 'filePath',
        type: 'string',
        description: 'A path to a .heapsnapshot file to read.',
        required: true,
        positional: true,
      },
      className: {
        name: 'className',
        type: 'string',
        description: 'Optional regex or text matching object class name.',
        required: false,
        positional: false,
      },
      propertyName: {
        name: 'propertyName',
        type: 'string',
        description:
          'Optional property name filter for outgoing reference edges.',
        required: false,
        positional: false,
      },
      nodeType: {
        name: 'nodeType',
        type: 'string',
        description:
          'Optional V8 node type filter (e.g. object, closure, string, array, code).',
        required: false,
        positional: false,
      },
      retainedSize: {
        name: 'retainedSize',
        type: 'string',
        description:
          'Inclusive retained size range (e.g. "1MB-2MB", "-1MB", or "1MB-"). A single value is treated as a minimum.',
        required: false,
        positional: false,
      },
      selfSize: {
        name: 'selfSize',
        type: 'string',
        description:
          'Inclusive self size range (e.g. "1MB-2MB", "-1MB", or "1MB-"). A single value is treated as a minimum.',
        required: false,
        positional: false,
      },
      isDetached: {
        name: 'isDetached',
        type: 'boolean',
        description: 'Whether to filter for detached DOM nodes.',
        required: false,
        positional: false,
      },
      sortBy: {
        name: 'sortBy',
        type: 'string',
        description: 'Sort order for results. Default is retainedSize.',
        required: false,
        positional: false,
        enum: ['retainedSize', 'selfSize', 'id'],
      },
      pageIdx: {
        name: 'pageIdx',
        type: 'integer',
        description:
          'The zero-based page index. Defaults to 0 (the first page).',
        required: false,
        positional: false,
        default: 0,
      },
      pageSize: {
        name: 'pageSize',
        type: 'integer',
        description:
          'The maximum number of items to return per page. Defaults to 50.',
        required: false,
        positional: false,
        default: 50,
      },
      maxNameLength: {
        name: 'maxNameLength',
        type: 'integer',
        description:
          'Maximum length of names before truncation. Defaults to 100.',
        required: false,
        positional: false,
      },
    },
  },
  reload_extension: {
    description:
      'Reloads an unpacked Chrome extension by its ID. (requires flag: --categoryExtensions=true)',
    category: 'Extensions',
    args: {
      id: {
        name: 'id',
        type: 'string',
        description: 'ID of the extension to reload.',
        required: true,
        positional: true,
      },
    },
  },
  remove_network_mock: {
    description:
      'Remove network mocks matching the supplied stored route and/or resource type. Route patterns are compared exactly, not applied as wildcards to other patterns. Omit both filters to remove all mocks for the page. Removing the last mock restores the HTTP cache and stops interception. Changes are rejected during a performance trace. (requires flag: --categoryNetworkMocks=true)',
    category: 'Network mocks',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      route: {
        name: 'route',
        type: 'string',
        description:
          'Absolute URLPattern, e.g. https://example.com/app.js or `*://*:*/app.js`. Use `*` for wildcards; omitted query strings match any query. Regex and `:name` groups are rejected. Inspection and removal compare the stored pattern exactly. Omit to inspect/remove all routes or match any URL.',
        required: false,
        positional: false,
      },
      resourceType: {
        name: 'resourceType',
        type: 'string',
        description:
          'Restrict requests and stored mock filters to this resource type. Omit to inspect/remove all types or configure a mock for any type.',
        required: false,
        positional: false,
        enum: [
          'document',
          'stylesheet',
          'image',
          'media',
          'font',
          'script',
          'texttrack',
          'xhr',
          'fetch',
          'prefetch',
          'eventsource',
          'manifest',
          'signedexchange',
          'ping',
          'cspviolationreport',
          'preflight',
          'fedcm',
          'other',
        ],
      },
    },
  },
  resize_page: {
    description:
      "Resizes the page's window so that the page has specified dimension",
    category: 'Emulation',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      width: {
        name: 'width',
        type: 'integer',
        description: 'Page width',
        required: true,
        positional: true,
      },
      height: {
        name: 'height',
        type: 'integer',
        description: 'Page height',
        required: true,
        positional: true,
      },
    },
  },
  screencast_start: {
    description: 'Starts recording a screencast (video) of the target page.',
    category: 'Debugging',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      filePath: {
        name: 'filePath',
        type: 'string',
        description:
          'Output file path (.mp4). Uses mkdtemp to generate a unique path if not provided.',
        required: false,
        positional: false,
      },
    },
  },
  screencast_stop: {
    description: 'Stops the active screencast recording on the target page.',
    category: 'Debugging',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
    },
  },
  select_page: {
    description: 'Select a page as a context for future tool calls.',
    category: 'Navigation automation',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description:
          'The ID of the page to select. Call list_pages to get available pages.',
        required: true,
        positional: true,
      },
      bringToFront: {
        name: 'bringToFront',
        type: 'boolean',
        description: 'Whether to focus the page and bring it to the top.',
        required: false,
        positional: false,
      },
    },
  },
  set_logpoints: {
    description:
      'Set the complete set of logpoints of the selected page: logpoints not in the list are removed, new ones are added, and an empty list removes all. A logpoint logs expressions to the console every time a line executes, without pausing or changing the source, like logpoints in the DevTools Sources panel. Locations are script URLs or original source files resolved through source maps (not available with --no-source-maps; scripts in workers and out-of-process iframes are not supported). A location in a generated script moves to its original source line when a source map covers it, and locations on the same line become one logpoint with the last expression. Output appears in list_console_messages; an expression that throws produces an error message without text. Logpoints survive reloads and navigations until removed or the page is closed. The response lists the resulting logpoints and where they are bound.',
    category: 'Debugging',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      logpoints: {
        name: 'logpoints',
        type: 'array',
        description:
          'Logpoints formatted as <url>:<lineNumber>[:<columnNumber>] <expression>. The url is a script URL or the path of an original source file from a source map, exact or as a path suffix (e.g. "src/app.ts"). Line and column numbers are 1-based in the coordinates of the url; a line without executable code moves to the next possible location. The expression is evaluated like console.log() arguments in the scope of the location, where local variables are accessible by their original names, and runs before the line executes, so a variable declared on that line is not set yet. list_console_messages shows objects as [object Object]: read them with get_console_message, or log JSON.stringify(value) for plain data. Example: "src/cart.ts:42 \'cart total:\', cart.total, cart.items.length". Pass an empty array to remove all logpoints.',
        required: true,
        positional: true,
      },
    },
  },
  take_heapsnapshot: {
    description:
      'Capture a heap snapshot of the target page. Use to analyze the memory distribution of JavaScript objects and debug memory leaks.',
    category: 'Memory',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      filePath: {
        name: 'filePath',
        type: 'string',
        description:
          'A path to a .heapsnapshot file to save the heapsnapshot to.',
        required: true,
        positional: true,
      },
    },
  },
  take_screenshot: {
    description: 'Take a screenshot of the page or element.',
    category: 'Debugging',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      format: {
        name: 'format',
        type: 'string',
        description:
          'Type of format to save the screenshot as. Default is "png"',
        required: false,
        positional: false,
        default: 'png',
        enum: ['png', 'jpeg', 'webp'],
      },
      quality: {
        name: 'quality',
        type: 'number',
        description:
          'Compression quality for JPEG and WebP formats (0-100). Higher values mean better quality but larger file sizes. Ignored for PNG format.',
        required: false,
        positional: false,
      },
      uid: {
        name: 'uid',
        type: 'string',
        description:
          'The uid of an element on the page from the page content snapshot. If omitted, takes a page screenshot.',
        required: false,
        positional: false,
      },
      fullPage: {
        name: 'fullPage',
        type: 'boolean',
        description:
          'If set to true takes a screenshot of the full page instead of the currently visible viewport. Incompatible with uid.',
        required: false,
        positional: false,
      },
      filePath: {
        name: 'filePath',
        type: 'string',
        description:
          'The absolute path, or a path relative to the current working directory, to save the screenshot to instead of attaching it to the response.',
        required: false,
        positional: false,
      },
    },
  },
  take_snapshot: {
    description:
      'Take a text snapshot of the target page based on the a11y tree. The snapshot lists page elements along with a unique\nidentifier (uid). Always use the latest snapshot. Prefer taking a snapshot over taking a screenshot. The snapshot indicates the element selected\nin the DevTools Elements panel (if any).',
    category: 'Debugging',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      verbose: {
        name: 'verbose',
        type: 'boolean',
        description:
          'Whether to include all possible information available in the full a11y tree. Default is false.',
        required: false,
        positional: false,
      },
      filePath: {
        name: 'filePath',
        type: 'string',
        description:
          'The absolute path, or a path relative to the current working directory, to save the snapshot to instead of attaching it to the response.',
        required: false,
        positional: false,
      },
    },
  },
  trigger_extension_action: {
    description:
      'Triggers the default action of an extension by its ID. (requires flag: --categoryExtensions=true)',
    category: 'Extensions',
    args: {
      id: {
        name: 'id',
        type: 'string',
        description: 'ID of the extension to trigger the action for.',
        required: true,
        positional: true,
      },
    },
  },
  type_text: {
    description: 'Type text using keyboard into a previously focused input',
    category: 'Input automation',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      text: {
        name: 'text',
        type: 'string',
        description: 'The text to type',
        required: true,
        positional: true,
      },
      submitKey: {
        name: 'submitKey',
        type: 'string',
        description:
          'Optional key to press after typing. E.g., "Enter", "Tab", "Escape"',
        required: false,
        positional: false,
      },
    },
  },
  uninstall_extension: {
    description:
      'Uninstalls a Chrome extension by its ID. (requires flag: --categoryExtensions=true)',
    category: 'Extensions',
    args: {
      id: {
        name: 'id',
        type: 'string',
        description: 'ID of the extension to uninstall.',
        required: true,
        positional: true,
      },
    },
  },
  uninstall_pwa: {
    description:
      'Uninstalls a Progressive Web App identified by its manifest ID and closes any open app windows. (requires flag: --categoryPwa=true)',
    category: 'Progressive Web Apps',
    args: {
      manifestId: {
        name: 'manifestId',
        type: 'string',
        description:
          'The manifest ID of the web app: the resolved `id` member of its manifest. If `id` is omitted, it defaults to the resolved `start_url` (e.g. "https://example.com/"). See https://w3c.github.io/manifest/#id-member.',
        required: true,
        positional: true,
      },
    },
  },
  upload_file: {
    description: 'Upload a file through a provided element.',
    category: 'Input automation',
    args: {
      pageId: {
        name: 'pageId',
        type: 'number',
        description: 'Targets a specific page by ID.',
        required: true,
        positional: true,
      },
      uid: {
        name: 'uid',
        type: 'string',
        description:
          'The uid of the file input element or an element that will open file chooser on the page from the page content snapshot',
        required: true,
        positional: true,
      },
      filePaths: {
        name: 'filePaths',
        type: 'array',
        description:
          'One or more files paths to upload. File paths have to be local to the browser instance (not the MCP).',
        required: true,
        positional: true,
      },
      includeSnapshot: {
        name: 'includeSnapshot',
        type: 'boolean',
        description:
          'Whether to include a snapshot in the response. Default is false.',
        required: false,
        positional: false,
      },
    },
  },
} as const;