get_codegen_session
Retrieve details of a specific code generation session by its ID, enabling efficient tracking and management of browser automation tasks within the Playwright MCP Server.
Instructions
Get information about a code generation session
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | ID of the session to retrieve |
Implementation Reference
- src/tools/codegen/index.ts:160-180 (handler)Full tool definition including the handler function that retrieves and returns the codegen session data by sessionId using ActionRecorder.export const getCodegenSession: Tool = { name: 'get_codegen_session', description: 'Get information about a code generation session', parameters: { type: 'object', properties: { sessionId: { type: 'string', description: 'ID of the session to retrieve' } }, required: ['sessionId'] }, handler: async ({ sessionId }: { sessionId: string }) => { const session = ActionRecorder.getInstance().getSession(sessionId); if (!session) { throw new Error(`Session ${sessionId} not found`); } return session; } };
- src/toolHandler.ts:355-364 (registration)Registration and dispatch logic in the main tool handler that calls the getCodegenSession.handler for 'get_codegen_session' tool calls.switch (name) { case 'start_codegen_session': return await handleCodegenResult(startCodegenSession.handler(args)); case 'end_codegen_session': return await handleCodegenResult(endCodegenSession.handler(args)); case 'get_codegen_session': return await handleCodegenResult(getCodegenSession.handler(args)); case 'clear_codegen_session': return await handleCodegenResult(clearCodegenSession.handler(args)); }
- src/tools.ts:50-63 (schema)MCP SDK tool definition with input schema for validating get_codegen_session parameters.{ name: "get_codegen_session", description: "Get information about a code generation session", inputSchema: { type: "object", properties: { sessionId: { type: "string", description: "ID of the session to retrieve" } }, required: ["sessionId"] } },
- src/toolHandler.ts:8-12 (registration)Import statement that brings the getCodegenSession tool into the main tool handler.startCodegenSession, endCodegenSession, getCodegenSession, clearCodegenSession } from './tools/codegen/index.js';