list_debug_sessions
View all active debugging sessions to monitor ongoing program analysis and manage debugging workflows efficiently.
Instructions
List all active debugging sessions
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:924-945 (handler)Handler function for the 'list_debug_sessions' tool. Retrieves all active debug sessions using sessionManager.getAllSessions(), maps them to a serializable format, and returns a JSON response with success status, sessions list, and count.private async handleListDebugSessions(): Promise<ServerResult> { try { const sessionsInfo: DebugSessionInfo[] = this.sessionManager.getAllSessions(); const sessionData = sessionsInfo.map((session: DebugSessionInfo) => { const mappedSession: Record<string, unknown> = { id: session.id, name: session.name, language: session.language as DebugLanguage, state: session.state, createdAt: session.createdAt.toISOString(), }; if (session.updatedAt) { mappedSession.updatedAt = session.updatedAt.toISOString(); } return mappedSession; }); return { content: [{ type: 'text', text: JSON.stringify({ success: true, sessions: sessionData, count: sessionData.length }) }] }; } catch (error) { this.logger.error('Failed to list debug sessions', { error }); throw new McpError(McpErrorCode.InternalError, `Failed to list debug sessions: ${(error as Error).message}`); } }
- Core helper method that returns all DebugSessionInfo objects from the session store. This is the actual implementation delegated to by the tool handler.public getAllSessions(): DebugSessionInfo[] { return this.sessionStore.getAll(); }
- src/server.ts:446-446 (schema)Tool schema definition in the listTools response, specifying name, description, and empty input schema (no arguments required).{ name: 'list_debug_sessions', description: 'List all active debugging sessions', inputSchema: { type: 'object', properties: {} } },
- src/server.ts:537-539 (registration)Registration of the tool handler in the CallToolRequestSchema switch statement, dispatching to handleListDebugSessions().result = await this.handleListDebugSessions(); break; }