remove_breakpoint
Remove debugging breakpoints by ID from PHP applications using Xdebug's DBGp protocol to control debugging sessions.
Instructions
Remove a breakpoint by its ID. Works for both active session breakpoints and pending breakpoints.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| breakpoint_id | Yes | The breakpoint ID to remove (session breakpoint ID or pending_* ID) | |
| session_id | No | Session ID |
Implementation Reference
- src/tools/breakpoints.ts:309-358 (handler)The core handler function for the 'remove_breakpoint' MCP tool. It determines if the breakpoint is pending or active in a session and delegates to the appropriate removal method, returning JSON-formatted success status.async ({ breakpoint_id, session_id }) => { // Check if it's a pending breakpoint if (breakpoint_id.startsWith('pending_')) { const success = pendingBreakpoints.removeBreakpoint(breakpoint_id); return { content: [ { type: 'text', text: JSON.stringify({ success, breakpoint_id, message: success ? 'Pending breakpoint removed' : 'Failed to remove pending breakpoint (may not exist)', }), }, ], }; } const session = sessionManager.resolveSession(session_id); if (!session) { return { content: [ { type: 'text', text: JSON.stringify({ error: 'No active debug session' }), }, ], }; } const success = await session.removeBreakpoint(breakpoint_id); return { content: [ { type: 'text', text: JSON.stringify({ success, breakpoint_id, message: success ? 'Breakpoint removed' : 'Failed to remove breakpoint (may not exist)', }), }, ], }; }
- src/tools/breakpoints.ts:306-308 (schema)Zod schema defining the input parameters for the remove_breakpoint tool: breakpoint_id (required string) and optional session_id.breakpoint_id: z.string().describe('The breakpoint ID to remove (session breakpoint ID or pending_* ID)'), session_id: z.string().optional().describe('Session ID'), },
- src/tools/breakpoints.ts:302-304 (registration)Registration of the 'remove_breakpoint' tool on the MCP server within registerBreakpointTools, including name and description.server.tool( 'remove_breakpoint', 'Remove a breakpoint by its ID. Works for both active session breakpoints and pending breakpoints.',
- Helper method in PendingBreakpointsManager to remove a pending breakpoint by ID from the internal Map.removeBreakpoint(id: string): boolean { const removed = this.pendingBreakpoints.delete(id); if (removed) { logger.info(`Pending breakpoint removed: ${id}`); this.emit('breakpointRemoved', id); } return removed;
- src/session/session.ts:230-240 (helper)Helper method in DebugSession to remove an active breakpoint by sending DBGP 'breakpoint_remove' command and updating local cache.async removeBreakpoint(breakpointId: string): Promise<boolean> { const response = await this.connection.sendCommand('breakpoint_remove', { d: breakpointId, }); if (!response.error) { this.breakpoints.delete(breakpointId); logger.debug(`Breakpoint removed: ${breakpointId}`); return true; } return false;