get-session-info
Retrieve detailed information about a specific code analysis session to understand current context, dependencies, and workflow status for development tasks.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | ID of the session to retrieve information for |
Implementation Reference
- Handler function for the 'get-session-info' tool. Retrieves the session by ID, extracts context, and returns structured information including session ID, selected tool, last execution time, history count, and error status. Wraps response in MCP format with error handling.async ({ sessionId }) => { try { const session = getSession(sessionId); const context = session.getContext(); const result = createSuccessResponse( { sessionId, selectedTool: context.selectedTool, lastExecutionTime: context.history.length > 0 ? context.history[context.history.length - 1].timestamp : null, executionHistory: context.history.length, hasError: !!context.error, }, "get-session-info" ); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: JSON.stringify( createErrorResponse( error instanceof Error ? error.message : String(error), "get-session-info" ), null, 2 ), }, ], isError: true, }; } } );
- Input schema for 'get-session-info' tool, requiring a 'sessionId' string parameter with description.{ sessionId: z .string() .describe("ID of the session to retrieve information for"), },
- src/features/session-manager/index.ts:83-135 (registration)Registration of the 'get-session-info' tool on the MCP server using server.tool(), including name, input schema, and inline handler function."get-session-info", { sessionId: z .string() .describe("ID of the session to retrieve information for"), }, async ({ sessionId }) => { try { const session = getSession(sessionId); const context = session.getContext(); const result = createSuccessResponse( { sessionId, selectedTool: context.selectedTool, lastExecutionTime: context.history.length > 0 ? context.history[context.history.length - 1].timestamp : null, executionHistory: context.history.length, hasError: !!context.error, }, "get-session-info" ); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { return { content: [ { type: "text", text: JSON.stringify( createErrorResponse( error instanceof Error ? error.message : String(error), "get-session-info" ), null, 2 ), }, ], isError: true, }; } } );