create-session
Initiate a new session on the MCP server for advanced code analysis, enabling syntax checks, dependency mapping, and AI-driven development workflow optimization, with optional session descriptions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | Optional description for this session |
Implementation Reference
- Handler function that executes the create-session tool: retrieves or creates a session, generates session ID, and returns a JSON success response with session details.async ({ description }) => { try { const session = getSession(); const sessionId = session.getSessionId(); const result = createSuccessResponse( { sessionId, description, created: new Date().toISOString() }, "create-session" ); 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), "create-session" ), null, 2 ), }, ], isError: true, }; } }
- Zod input schema for the create-session tool, defining an optional 'description' string parameter.{ description: z .string() .optional() .describe("Optional description for this session"), },
- src/features/session-manager/index.ts:34-79 (registration)Registration of the 'create-session' tool on the MCP server using server.tool(), including inline schema and handler.server.tool( "create-session", { description: z .string() .optional() .describe("Optional description for this session"), }, async ({ description }) => { try { const session = getSession(); const sessionId = session.getSessionId(); const result = createSuccessResponse( { sessionId, description, created: new Date().toISOString() }, "create-session" ); 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), "create-session" ), null, 2 ), }, ], isError: true, }; } } );