项目文件夹

文件
Nikolay Vitkov 66a0cb1361 rename everything
2026-04-09 10:49:55 +02:00

12 KiB

Chrome DevTools MCP Tool Reference (~6199 cl100k_base tokens)

Input automation

click

Description: Clicks on the provided element

Parameters:

  • uid (string) (required): Element UID from snapshot.
  • dblClick (boolean) (optional): Set to true for double clicks. If omitted: false
  • includeSnapshot (boolean) (optional): Include snapshot in response. If omitted: false

drag

Description: Drag an element onto another element

Parameters:

  • from_uid (string) (required): UID of element to drag.
  • to_uid (string) (required): UID of element to drop into.
  • includeSnapshot (boolean) (optional): Include snapshot in response. If omitted: false

fill

Description: Type text into input, textarea, or select option.

Parameters:

  • uid (string) (required): Element UID from snapshot.
  • value (string) (required): Value to fill.
  • includeSnapshot (boolean) (optional): Include snapshot in response. If omitted: false

fill_form

Description: Fill multiple form elements.

Parameters:

  • elements (array) (required): Elements from snapshot to fill out.
  • includeSnapshot (boolean) (optional): Include snapshot in response. If omitted: false

handle_dialog

Description: Handle open browser dialog.

Parameters:

  • action (enum: "accept", "dismiss") (required): Dismiss or accept dialog.
  • promptText (string) (optional): Prompt text to enter.

hover

Description: Hover over the provided element

Parameters:

  • uid (string) (required): Element UID from snapshot.
  • includeSnapshot (boolean) (optional): Include snapshot in response. If omitted: false

press_key

Description: Press a key or combination. Use for shortcuts or when fill() fails.

Parameters:

  • key (string) (required): Key or combination (e.g., "Enter", "Control+A"). Modifiers: Control, Shift, Alt, Meta.
  • includeSnapshot (boolean) (optional): Include snapshot in response. If omitted: false

type_text

Description: Type text into focused input.

Parameters:

  • text (string) (required): Text to type.
  • submitKey (string) (optional): Optional key to press after typing. E.g., "Enter", "Tab", "Escape"

upload_file

Description: Upload file through element.

Parameters:

  • filePath (string) (required): Local path of file to upload.
  • uid (string) (required): UID of file input or element opening file chooser.
  • includeSnapshot (boolean) (optional): Include snapshot in response. If omitted: false

Navigation automation

close_page

Description: Close page by ID. Cannot close last page.

Parameters:

  • pageId (number) (required): The ID of the page to close. Call list_pages to list pages.

list_pages

Description: List open pages.

Parameters: None


navigate_page

Description: Go to URL, back, forward, or reload.

Parameters:

  • handleBeforeUnload (enum: "accept", "decline") (optional): Auto accept beforeunload dialogs. If omitted: accept
  • ignoreCache (boolean) (optional): Ignore cache on reload.
  • initScript (string) (optional): JS script to execute on new documents.
  • timeout (integer) (optional): Max wait time in ms. 0 for default.
  • type (enum: "url", "back", "forward", "reload") (optional): Navigation type.
  • url (string) (optional): Target URL.

new_page

Description: Open new tab and load URL.

Parameters:

  • url (string) (required): URL to load.
  • background (boolean) (optional): Open page in background. If omitted: false (foreground)
  • isolatedContext (string) (optional): Isolated browser context name. Shared cookies/storage within context.
  • timeout (integer) (optional): Max wait time in ms. 0 for default.

select_page

Description: Select a page as a context for future tool calls.

Parameters:

  • pageId (number) (required): The ID of the page to select. Call list_pages to get available pages.
  • bringToFront (boolean) (optional): Focus page and bring to top.

wait_for

Description: Wait for the specified text to appear on the page.

Parameters:

  • text (array) (required): Non-empty list of texts. Resolves when any value appears on the page.
  • timeout (integer) (optional): Max wait time in ms. 0 for default.

Emulation

emulate

Description: Emulate features on page.

Parameters:

  • colorScheme (enum: "dark", "light", "auto") (optional): Emulate dark or light mode. "auto" to reset.
  • cpuThrottlingRate (number) (optional): CPU slowdown factor. 1 to disable.
  • geolocation (string) (optional): Geolocation (<lat>x<lon>). Lat: -90 to 90. Lon: -180 to 180.
  • networkConditions (enum: "Offline", "Slow 3G", "Fast 3G", "Slow 4G", "Fast 4G") (optional): Throttle network. Omit to disable.
  • userAgent (string) (optional): User agent to emulate. Empty string to clear.
  • viewport (string) (optional): Viewport spec: '<w>x<h>x<dpr>[,mobile][,touch][,landscape]'.

resize_page

Description: Resize page window.

Parameters:

  • height (number) (required): Page height
  • width (number) (required): Page width

Performance

performance_analyze_insight

Description: Get details on a specific Performance Insight.

Parameters:

  • insightName (string) (required): Insight name (e.g., "DocumentLatency").
  • insightSetId (string) (required): ID for specific insight set. Use IDs from results.

performance_start_trace

Description: Start performance trace. Use to find issues and improve speed.

Parameters:

  • autoStop (boolean) (optional): Auto stop trace recording.
  • filePath (string) (optional): Path to save raw trace data. E.g., trace.json.gz.
  • reload (boolean) (optional): Reload page. Use navigate_page BEFORE starting if true.

performance_stop_trace

Description: Stop active performance trace.

Parameters:

  • filePath (string) (optional): Path to save raw trace data. E.g., trace.json.gz.

take_memory_snapshot

Description: Capture a heap snapshot to analyze JS memory distribution and debug leaks.

Parameters:

  • filePath (string) (required): A path to a .heapsnapshot file to save the heapsnapshot to.

Network

get_network_request

Description: Gets a network request by an optional reqid. If omitted: selected request

Parameters:

  • reqid (number) (optional): The reqid of the network request. If omitted: selected request
  • requestFilePath (string) (optional): The absolute or relative path to save the request body to. If omitted: inline
  • responseFilePath (string) (optional): The absolute or relative path to save the response body to. If omitted: inline

list_network_requests

Description: List network requests since last navigation.

Parameters:

  • includePreservedRequests (boolean) (optional): Return preserved requests over last 3 navigations.
  • pageIdx (integer) (optional): Page number (0-based). If omitted: 0.
  • pageSize (integer) (optional): Max requests to return. If omitted: all.
  • resourceTypes (array) (optional): Filter by resource types. If omitted: all.

Debugging

evaluate_script

Description: Evaluate JS function in page. Returns JSON-serializable response.

Parameters:

  • function (string) (required): JS function to execute. Examples: () => document.title, (el) => el.innerText.
  • args (array) (optional): Arguments to pass to the function.

get_console_message

Description: Gets a console message by its ID. You can get all messages by calling list_console_messages.

Parameters:

  • msgid (number) (required): The msgid of a console message on the page from the listed console messages

lighthouse_audit

Description: Get Lighthouse score for a11y, SEO, and best practices. Excludes performance (use performance_start_trace).

Parameters:

  • device (enum: "desktop", "mobile") (optional): Device to emulate.
  • mode (enum: "navigation", "snapshot") (optional): "navigation" reloads & audits. "snapshot" analyzes current state.
  • outputDirPath (string) (optional): Directory for reports. Default temporary files.

list_console_messages

Description: List console messages since last navigation.

Parameters:

  • includePreservedMessages (boolean) (optional): Return preserved messages over last 3 navigations.
  • pageIdx (integer) (optional): Page number (0-based). If omitted: 0.
  • pageSize (integer) (optional): Max messages to return. If omitted: all.
  • types (array) (optional): Filter by message types. If omitted: all.

take_screenshot

Description: Take a screenshot of the page or element.

Parameters:

  • filePath (string) (optional): The absolute path, or a path relative to the current working directory, to save the screenshot to instead of attaching it to the response.
  • format (enum: "png", "jpeg", "webp") (optional): Type of format to save the screenshot as. If omitted: "png"
  • fullPage (boolean) (optional): If set to true takes a screenshot of the full page instead of the currently visible viewport. Incompatible with uid.
  • quality (number) (optional): Compression quality for (0-100). Higher values mean better quality but larger sizes. Ignored for PNG format.
  • uid (string) (optional): Element UID from snapshot. If omitted: page screenshot

take_snapshot

Description: Take a text snapshot using the a11y tree. Lists elements with a unique ID (uid). Prefer snapshots over screenshots. Indicates the element selected in the DevTools Elements panel.

Parameters:

  • filePath (string) (optional): The absolute path, or a path relative to the current working directory, to save the snapshot to instead of attaching it to the response.
  • verbose (boolean) (optional): Include all info in the a11y tree. If omitted: false