set_breakpoint
Set a breakpoint at a local file and line number to pause execution during a PHP debugging session. Optionally add a condition to break only when a PHP expression is true.
Instructions
Sets a breakpoint at a specific file and line. Breakpoints persist until the session ends.
WHEN TO USE:
BEFORE calling start_debug_session to set initial breakpoints
DURING a paused session to add additional breakpoints
PATH FORMAT - Use LOCAL paths relative to your project root:
Correct: "app/Http/Controllers/UserController.php"
Correct: "src/Services/PaymentService.php"
Wrong: "/var/www/html/app/..." (don't use container paths)
The tool automatically translates local paths to container paths using mappings from .vscode/launch.json, docker-compose.yml, or XDEBUG_MCP_PATH_MAPPINGS env var.
CONDITIONAL BREAKPOINTS - For loops, ALWAYS use conditions:
'$i > 100' - Break when loop counter exceeds 100
'$user->id === 42' - Break for specific user
'count($items) > 0' - Break when array has items
RETURNS:
breakpoint_id: Unique identifier
remotePath: The translated container path (verify this matches your container)
warning: Included if local file doesn't exist
AFTER SETTING: Call start_debug_session to begin debugging.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | LOCAL file path relative to project root. Example: "app/Http/Controllers/UserController.php". Do NOT use container paths like /var/www/html/... | |
| line | Yes | Line number to break at. Use the line with the code you want to inspect. | |
| condition | No | PHP expression - break only if true. HIGHLY RECOMMENDED for loops. Examples: '$user->id === 5', '$i > 100', 'count($items) > 0' |