Skip to main content
Glama

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
NameRequiredDescriptionDefault
sessionIdYesID 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"), },
  • 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, }; } } );

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/0xjcf/MCP_CodeAnalysis'

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