Skip to main content
Glama

dap

Initiate a DAP server to connect with clients for debugging Go programs via the Delve debugger, enabling code analysis and tracing using natural language commands.

Instructions

Start a DAP (Debug Adapter Protocol) server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
clientAddrNoOptional address where DAP client is waiting for connection

Implementation Reference

  • The main handler logic for the 'dap' tool. Extracts optional clientAddr, prepares dlv args, starts DAP session via startDebugSession, returns session info.
    case "dap": { const { clientAddr } = args; const cmdArgs = clientAddr ? ["--client-addr", clientAddr] : []; const session = await startDebugSession("dap", "", cmdArgs); return { content: [{ type: "text", text: `Started DAP server session ${session.id}${clientAddr ? ` connecting to ${clientAddr}` : ''}` }] }; }
  • Input schema and metadata definition for the 'dap' tool in the tools list.
    { name: "dap", description: "Start a DAP (Debug Adapter Protocol) server", inputSchema: { type: "object", properties: { clientAddr: { type: "string", description: "Optional address where DAP client is waiting for connection" } } } },
  • src/server.ts:406-407 (registration)
    Dispatches 'dap' tool invocations to the debug handler in the CallToolRequestSchema handler.
    if (["debug", "attach", "exec", "test", "core", "dap", "replay", "trace"].includes(name)) { return handleDebugCommands(name, args);
  • Core utility that starts the dlv process in 'dap' mode when called with type='dap', binding to a dynamic port and registering 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; }
  • Type definition for DebugSession.type including 'dap'.
    type: string; // 'debug' | 'attach' | 'exec' | 'test' | 'core' | 'replay' | 'trace' | 'dap'

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