removeBreakpoint
Remove a breakpoint by specifying the debug session and breakpoint ID.
Instructions
Remove a breakpoint
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | ID of the debug session | |
| breakpointId | Yes | ID of the breakpoint to remove |
Implementation Reference
- src/handlers/control.ts:39-50 (handler)The handler function that executes the removeBreakpoint tool logic. It extracts breakpointId from args, sends a ClearBreakpoint command to the Delve session, removes the breakpoint from the session's breakpoints map, and returns a confirmation message.
case "removeBreakpoint": { const { breakpointId } = args; await sendDelveCommand(session, "ClearBreakpoint", { id: breakpointId }); session.breakpoints.delete(breakpointId); return { content: [{ type: "text", text: `Removed breakpoint ${breakpointId}` }] }; } - src/server.ts:164-180 (schema)Tool registration schema for removeBreakpoint, defining its name, description, and inputSchema with sessionId (string) and breakpointId (number) as required properties.
name: "removeBreakpoint", description: "Remove a breakpoint", inputSchema: { type: "object", properties: { sessionId: { type: "string", description: "ID of the debug session" }, breakpointId: { type: "number", description: "ID of the breakpoint to remove" } }, required: ["sessionId", "breakpointId"] } }, - src/server.ts:411-412 (registration)The request handler routing: 'removeBreakpoint' is listed as a control command and dispatched to handleControlCommands() in control.ts.
if (["setBreakpoint", "removeBreakpoint", "continue", "next", "step", "stepout", "variables", "evaluate"].includes(name)) { return handleControlCommands(name, args); - src/types.ts:6-11 (helper)The Breakpoint interface type used to type the breakpoint objects managed by the session. This is relevant because removeBreakpoint deletes entries from session.breakpoints (Map<number, Breakpoint>).
export interface Breakpoint { id: number; file: string; line: number; condition?: string; } - src/session.ts:69-72 (helper)The sendDelveCommand utility function used by the removeBreakpoint handler to send the ClearBreakpoint API command to the Delve debugger.
export async function sendDelveCommand(session: DebugSession, command: string, args: any = {}): Promise<any> { const { stdout } = await exec(`curl -s -X POST http://localhost:${session.port}/api/v2/${command} -d '${JSON.stringify(args)}'`); return JSON.parse(stdout); }