Skip to main content
Glama

setBreakpoint

Set a breakpoint in Go programs during debugging sessions by specifying the file, line number, and optional condition using the Delve debugger interface.

Instructions

Set a breakpoint in the debugged program

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conditionNoOptional condition for the breakpoint
fileYesFile path where to set the breakpoint
lineYesLine number for the breakpoint
sessionIdYesID of the debug session

Implementation Reference

  • The switch case that implements the core logic of the setBreakpoint tool. It extracts file, line, and optional condition from args, sends a CreateBreakpoint command to the Delve debug session, stores the breakpoint in the session, and returns a confirmation message.
    case "setBreakpoint": { const { file, line, condition } = args; const response = await sendDelveCommand(session, "CreateBreakpoint", { file, line, cond: condition }); const bp: Breakpoint = { id: response.id, file, line, condition }; session.breakpoints.set(bp.id, bp); return { content: [{ type: "text", text: `Set breakpoint ${bp.id} at ${file}:${line}` }] }; }
  • Input schema defining the parameters for the setBreakpoint tool: required sessionId, file, line; optional condition.
    inputSchema: { type: "object", properties: { sessionId: { type: "string", description: "ID of the debug session" }, file: { type: "string", description: "File path where to set the breakpoint" }, line: { type: "number", description: "Line number for the breakpoint" }, condition: { type: "string", description: "Optional condition for the breakpoint" } }, required: ["sessionId", "file", "line"] }
  • src/server.ts:137-162 (registration)
    Registration of the setBreakpoint tool in the list of tools returned by listTools, including name, description, and input schema.
    { name: "setBreakpoint", description: "Set a breakpoint in the debugged program", inputSchema: { type: "object", properties: { sessionId: { type: "string", description: "ID of the debug session" }, file: { type: "string", description: "File path where to set the breakpoint" }, line: { type: "number", description: "Line number for the breakpoint" }, condition: { type: "string", description: "Optional condition for the breakpoint" } }, required: ["sessionId", "file", "line"] } },
  • Routing logic in the CallToolRequestHandler that directs setBreakpoint calls to the handleControlCommands function.
    // Control commands if (["setBreakpoint", "removeBreakpoint", "continue", "next", "step", "stepout", "variables", "evaluate"].includes(name)) { return handleControlCommands(name, args); }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dwisiswant0/delve-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server