clear_codegen_session
Clears a code generation session in the Playwright MCP Server by removing the session data, ensuring a fresh start without generating test output.
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:185-205 (handler)The clearCodegenSession tool object defining the handler function that executes the tool logic by clearing the specified codegen session using ActionRecorder.clearSession().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:65-77 (schema)MCP input schema definition for the clear_codegen_session tool, used for tool discovery and validation.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:338-339 (registration)Registration and dispatch of the clear_codegen_session tool in the main handleToolCall switch statement, routing to the specific handler.case "clear_codegen_session": return await handleCodegenResult(clearCodegenSession.handler(args));
- src/tools/codegen/index.ts:211-211 (registration)Inclusion of clearCodegenSession in the codegenTools export array for grouping codegen-related tools.clearCodegenSession,
- src/tools.ts:441-441 (registration)Listing of clear_codegen_session in the CODEGEN_TOOLS constant array.'clear_codegen_session'