chrome-devtools-mcp evaluate_script saves output with filePath
Introduced 2026-05-18 · score 0.95
HOW TO USE IT
When evaluating a page script and its output should be saved, pass `filePath` to `evaluate_script`; omitting it returns the output inline.
evaluate_script({"pageId": <pageId>, "function": "() => document.title", "filePath": "<absolute-or-relative-path>"})WHY THIS HELPS
When evaluating a script whose output should be saved to a repository file, provide `filePath` to `evaluate_script`.
REQUIREMENTS AND LIMITATIONS
- Version: 1.0.0
- pageId (required): Targets a specific page by ID.
- function: JavaScript source to execute; provide either this or `sourcePath`, not both.
- filePath: Absolute or relative path to save the script output; if omitted, output is returned inline.
- `filePath` accepts an absolute or relative path.
- The `filePath` parameter is optional.
- The supplied description says the path is validated.
FIRST-PARTY EVIDENCE
- https://github.com/ChromeDevTools/chrome-devtools-mcp/releases/tag/chrome-devtools-mcp-v1.0.0
- https://github.com/ChromeDevTools/chrome-devtools-mcp/pull/2054
- https://github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/tool-reference.md
Check the installed version and the source before using it. Entry JSON