get_script_source
Read a specific region of script source code without executing or pausing the page. Use URL for stable identification or scriptId for inline/eval scripts.
Instructions
Reads a small source region around a search match, paused location, or known statement without executing or pausing the page. Select by URL when available because URL-backed scripts can be resolved again after navigation; use the debugger-context-scoped scriptId only for current inline/eval scripts. Use line ranges for normal source and offset/length for minified single-line bundles. For a whole, minified, or WASM source, use save_script_source; to observe runtime values next, call set_breakpoint_on_text against the original loaded source.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | URL from list_scripts, search_in_sources, or a call stack. Preferred stable selector for URL-backed scripts; resolution tries an exact match before a substring match, so provide enough of the URL to avoid ambiguity. | |
| length | No | Maximum characters to return from offset (default: 1000). This is ignored unless offset is provided. | |
| offset | No | Zero-based character offset into the original source. Use for a bounded read of minified single-line code when line ranges would be too large. | |
| endLine | No | Inclusive 1-based end line for a bounded multi-line snippet. Omit both line bounds and use offset/length for a minified single-line bundle. | |
| scriptId | No | Debugger-context-scoped script ID from list_scripts, search_in_sources, or paused information. Required for unnamed inline/eval scripts, but invalid after reload, navigation, or debugger target/frame change; prefer url for external scripts. | |
| startLine | No | Inclusive 1-based start line, typically copied from search_in_sources or paused information. Use with endLine for normal multi-line source. |
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. |