Skip to main content
Glama

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
NameRequiredDescriptionDefault
sessionIdYesID of the session to clear

Implementation Reference

  • 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 }; } };
  • 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"] } },
  • Registration and routing logic in the main tool handler switch statement that directs calls to clearCodegenSession.handler
    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: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'
  • Import of the clearCodegenSession tool implementation into the main tool handler.
    startCodegenSession, endCodegenSession, getCodegenSession, clearCodegenSession

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

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