Skip to main content
Glama
devskido

Playwright MCP Server

by devskido

get_codegen_session

Retrieve details about a specific code generation session using its session ID to access browser automation results and generated test code.

Instructions

Get information about a code generation session

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesID of the session to retrieve

Implementation Reference

  • The core handler implementation for the 'get_codegen_session' tool. It retrieves the codegen session data using ActionRecorder.getInstance().getSession(sessionId) and returns it, or throws an error if not found.
    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;
      }
    };
  • Registration/dispatch logic in the main toolHandler where 'get_codegen_session' is handled by calling its handler via handleCodegenResult.
    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));
    }
  • Input schema definition for 'get_codegen_session' tool provided to the MCP server via createToolDefinitions().
    {
      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"]
      }
  • Import statement registering the getCodegenSession tool object into the main toolHandler.
    import { 
      startCodegenSession,
      endCodegenSession,
      getCodegenSession,
      clearCodegenSession
    } from './tools/codegen/index.js';
  • Export of codegenTools array including getCodegenSession for use in other modules.
    export const codegenTools = [
      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/devskido/customed-playwright'

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