Skip to main content
Glama

clear_codegen_session

Clear a code generation session in Playwright browser automation to reset state without creating new tests.

Instructions

Clear a code generation session without generating a test

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesID of the session to clear

Implementation Reference

  • The core handler function for the clear_codegen_session tool. It calls ActionRecorder.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 }, _context?: { server?: any }) => { const success = ActionRecorder.getInstance().clearSession(sessionId); if (!success) { throw new Error(`Session ${sessionId} not found`); } return { success }; }, };
  • Registers and dispatches the clear_codegen_session tool call to its handler function via the main tool switch statement.
    case "clear_codegen_session": return await handleCodegenResult(clearCodegenSession.handler(args, { server }));
  • Defines the input schema for clear_codegen_session used in MCP tool definitions (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/tools.ts:532-532 (registration)
    Lists clear_codegen_session in the CODEGEN_TOOLS array for tool categorization.
    "clear_codegen_session",
  • Imports the clearCodegenSession Tool object for use in tool handling.
    clearCodegenSession, endCodegenSession, getCodegenSession, startCodegenSession,

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/aakashH242/mcp-playwright'

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