clear_codegen_session
Terminate a code generation session by removing associated data without generating a test, ensuring efficient resource management in browser automation workflows.
Instructions
Clear a code generation session without generating a test
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | ID of the session to clear |
Implementation Reference
- src/tools/codegen/index.ts:182-202 (handler)The primary handler function for the 'clear_codegen_session' tool. It calls ActionRecorder.getInstance().clearSession(sessionId) to remove the session data and returns success status.export const clearCodegenSession: Tool = { name: 'clear_codegen_session', description: 'Clear a code generation session', parameters: { type: 'object', properties: { sessionId: { type: 'string', description: 'ID of the session to clear' } }, required: ['sessionId'] }, handler: async ({ sessionId }: { sessionId: string }) => { const success = ActionRecorder.getInstance().clearSession(sessionId); if (!success) { throw new Error(`Session ${sessionId} not found`); } return { success }; } };
- src/tools.ts:64-77 (schema)Input schema definition for the 'clear_codegen_session' tool, used in MCP tool registration via createToolDefinitions().{ name: "clear_codegen_session", description: "Clear a code generation session without generating a test", inputSchema: { type: "object", properties: { sessionId: { type: "string", description: "ID of the session to clear" } }, required: ["sessionId"] } },
- src/toolHandler.ts:364-373 (registration)Registration and routing logic in the main tool handler switch statement that directs calls to clearCodegenSession.handlerswitch (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:485-489 (registration)The tool name is listed in the CODEGEN_TOOLS array for categorization and conditional handling.export const CODEGEN_TOOLS = [ 'start_codegen_session', 'end_codegen_session', 'get_codegen_session', 'clear_codegen_session'
- src/toolHandler.ts:8-11 (registration)Import of the clearCodegenSession tool implementation into the main tool handler.startCodegenSession, endCodegenSession, getCodegenSession, clearCodegenSession