set_breakpoint
Set a line or column breakpoint in a web app script, using source paths mapped through source maps or exact Chrome URLs, with optional conditional triggers.
Instructions
Set a breakpoint at a 1-based line (and column) of a file. Name the file with source — a path like "src/App.tsx", or the url of a frame get_debugger_state or get_console_logs reported. Either way the position is mapped through source maps into the code Chrome runs, so that code must already be loaded. url/urlRegex instead take a position in the script exactly as Chrome loads it, so a source-mapped position given to them lands on the wrong line or never binds; use a frame's compiledUrl/compiledLine/compiledColumn. The script need not be loaded yet: an empty resolvedLocations means no loaded script matches yet, and the breakpoint binds when one loads — or never, if the URL is wrong. A source breakpoint is removed once its file changes, so set it again after an edit; the next state or navigation result lists it under droppedBreakpoints. A url/urlRegex breakpoint is kept through edits, so it may then stop on other code, or not at all.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"lineNumber": "<lineNumber>"
},
"name": "set_breakpoint"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Exact URL of the script as Chrome loaded it. Provide this, urlRegex or source; if both url and urlRegex, urlRegex takes precedence. | |
| source | No | File to break in, as in your project: a path like "src/App.tsx" — more of it when the name alone matches several loaded files — an absolute path, or a source-mapped url. lineNumber and columnNumber are positions in this file. | |
| urlRegex | No | Regex on the URL of the script as Chrome loaded it. Provide this, url or source; if both url and urlRegex, urlRegex takes precedence. | |
| condition | No | JS expression; breakpoint triggers only when truthy | |
| lineNumber | Yes | Line number (1-indexed) | |
| columnNumber | No | Column number, 1-indexed (optional) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | ||
| breakpointId | Yes | ||
| resolvedLocations | Yes | Where Chrome bound it in each loaded script, 1-based; source* give the source-mapped position. May be empty for url/urlRegex if the script is not loaded yet; the breakpoint will bind automatically when Chrome parses the script |