Skip to main content
Glama
pvinis
by pvinis

get_codegen_session

Retrieve details of a specific code generation session by providing its session ID, enabling tracking and management of automated test code creation within the Playwright MCP Server environment.

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 by ID from the ActionRecorder instance 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 and dispatch logic in the main tool handler switch statement, which calls the getCodegenSession.handler function.
    case "get_codegen_session":
      return await handleCodegenResult(getCodegenSession.handler(args));
  • Input schema definition for the 'get_codegen_session' tool used in MCP tool definitions.
    {
      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"]
      }
  • src/tools.ts:438-441 (registration)
    The tool is listed in the CODEGEN_TOOLS array for categorization and conditional handling.
    'start_codegen_session',
    'end_codegen_session',
    'get_codegen_session',
    'clear_codegen_session'
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it 'gets information,' implying a read-only operation, but doesn't specify whether this requires authentication, has rate limits, returns structured data, or what happens if the session doesn't exist. This is a significant gap for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple retrieval tool, though it could be slightly more informative without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no annotations and no output schema, the description is incomplete. It doesn't explain what information is returned (e.g., session status, code generated), behavioral aspects like error handling, or how it fits with sibling tools. This leaves gaps for an AI agent to understand the full context of use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single parameter 'sessionId' documented as 'ID of the session to retrieve.' The description adds no additional meaning beyond this, such as format examples or source context. Given the high schema coverage, the baseline score of 3 is appropriate as the schema handles the parameter documentation adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'information about a code generation session', making the purpose understandable. However, it doesn't distinguish this from sibling tools like 'start_codegen_session' or 'end_codegen_session' beyond the basic action, missing specific differentiation about what information is retrieved versus what those other tools do.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an existing session ID from 'start_codegen_session'), exclusions, or comparisons to other tools like 'clear_codegen_session', leaving the agent to infer usage context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Related Tools

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

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