Skip to main content
Glama

exec

Debug precompiled Go binaries by specifying the binary path and arguments. Integrates with Delve MCP to enable debugging, tracing, and analysis of Go programs using natural language commands.

Instructions

Debug a precompiled binary

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoArguments to pass to the binary
binaryYesPath to the binary

Implementation Reference

  • Executes the core logic of the 'exec' tool: parses binary path and arguments from input, invokes startDebugSession to launch Delve in exec mode, and returns the new session details.
    case "exec": { const binary = String(args?.binary); const cmdArgs = (args?.args as string[]) || []; const session = await startDebugSession("exec", binary, cmdArgs); return { content: [{ type: "text", text: `Started debug session ${session.id} for binary ${binary}` }] }; }
  • Input schema definition for the 'exec' tool, specifying required 'binary' path and optional command line 'args'.
    { name: "exec", description: "Debug a precompiled binary", inputSchema: { type: "object", properties: { binary: { type: "string", description: "Path to the binary" }, args: { type: "array", items: { type: "string" }, description: "Arguments to pass to the binary" } }, required: ["binary"] } },
  • src/server.ts:406-408 (registration)
    Registers 'exec' tool by including it in the dispatch condition within the CallToolRequest handler, routing calls to handleDebugCommands.
    if (["debug", "attach", "exec", "test", "core", "dap", "replay", "trace"].includes(name)) { return handleDebugCommands(name, args); }
  • Core helper that implements session startup for 'exec' by spawning the 'dlv exec --headless --listen=... binary [args]' process and managing the session.
    export async function startDebugSession(type: string, target: string, args: string[] = []): Promise<DebugSession> { const port = await getAvailablePort(); const id = Math.random().toString(36).substring(7); const dlvArgs = [ type, "--headless", `--listen=:${port}`, "--accept-multiclient", "--api-version=2", target, ...args ]; const process = spawn("dlv", dlvArgs, { stdio: ["pipe", "pipe", "pipe"] }); const session: DebugSession = { id, type, target, process, port, breakpoints: new Map() }; sessions.set(id, session); return session; }

Other Tools

Related Tools

  • @dwisiswant0/delve-mcp
  • @dwisiswant0/delve-mcp
  • @dwisiswant0/delve-mcp
  • @dwisiswant0/delve-mcp
  • @dwisiswant0/delve-mcp
  • @dwisiswant0/delve-mcp

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