save_script_source
Save the full JavaScript or WebAssembly source to a local file for detailed analysis, with support for formatting minified code.
Instructions
Saves one complete JavaScript or WASM source for local inspection when an inline snippet is insufficient, especially for large or minified bundles. Prefer get_script_source for a small known region and search_in_sources to locate text across loaded scripts first. With format=true, destinations using a supported JavaScript/TypeScript extension are formatted by default; other extensions preserve raw source, and formatted line numbers may differ from the live page. Use distinctive text plus the original URL with set_breakpoint_on_text for runtime debugging. The returned filename is the resolved local path, while scriptId remains scoped to the current debugger context.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | URL from list_scripts, search_in_sources, or a call stack. Preferred over scriptId because it can be resolved again after navigation; exact match is tried before substring match. | |
| format | No | Format supported JavaScript/TypeScript extensions for readability (default: true). Set false when exact source bytes or original line layout matter; formatted line numbers cannot be used as live breakpoint locations. | |
| filePath | Yes | Destination path for the complete source, absolute or relative to the server working directory and subject to --allowedRoots. A JavaScript/TypeScript extension enables formatting; use .wasm for bytecode or another extension to preserve raw text. | |
| scriptId | No | Debugger-context-scoped script ID from list_scripts or search_in_sources. Use for unnamed inline/eval scripts; it becomes invalid after reload, navigation, or debugger target/frame change. | |
| confirmOverwrite | No | Set true only to authorize replacing an existing filePath. A new file does not require overwrite confirmation. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the tool completed successfully. | |
| data | No | Machine-readable result payload. | |
| tool | Yes | Stable MCP tool name. | |
| error | No | ||
| summary | Yes | Concise human-readable outcome. |