Skip to main content
Glama

start_session

Begin a new AI coding session by specifying a development task, enabling persistent memory and project tracking for the assistant's work.

Instructions

Start a new AI coding session with a specific task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskYesDescription of the task to work on

Implementation Reference

  • MCP server handler for 'start_session' tool: extracts task argument and delegates to MemoryManager.startNewSession, returns confirmation with session ID.
    case 'start_session': {
      const task = args.task as string;
      const sessionId = await this.memoryManager.startNewSession(task);
      return { content: [{ type: 'text', text: `Started session: ${sessionId}` }] };
    }
  • Input schema definition for the 'start_session' tool: requires a 'task' string describing the coding task.
    {
      name: 'start_session',
      description: 'Start a new AI coding session with a specific task',
      inputSchema: {
        type: 'object',
        properties: {
          task: { type: 'string', description: 'Description of the task to work on' }
        },
        required: ['task']
      }
    },
  • src/index.ts:552-778 (registration)
    Registration of all tools including 'start_session' via ListToolsRequestSchema handler.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        // Memory Management Tools
        {
          name: 'start_session',
          description: 'Start a new AI coding session with a specific task',
          inputSchema: {
            type: 'object',
            properties: {
              task: { type: 'string', description: 'Description of the task to work on' }
            },
            required: ['task']
          }
        },
        {
          name: 'add_session_step',
          description: 'Record completion of a step in the current session',
          inputSchema: {
            type: 'object',
            properties: {
              step: { type: 'string', description: 'Description of the completed step' },
              filesModified: { type: 'array', items: { type: 'string' }, description: 'List of files that were modified' },
              description: { type: 'string', description: 'Optional detailed description' }
            },
            required: ['step', 'filesModified']
          }
        },
        {
          name: 'add_decision',
          description: 'Record an important technical decision',
          inputSchema: {
            type: 'object',
            properties: {
              key: { type: 'string', description: 'Decision key/name' },
              value: { type: 'string', description: 'Decision value' },
              reasoning: { type: 'string', description: 'Reasoning behind the decision' }
            },
            required: ['key', 'value', 'reasoning']
          }
        },
        {
          name: 'get_project_memory',
          description: 'Get current project memory and session state',
          inputSchema: {
            type: 'object',
            properties: {}
          }
        },
    
        // Approval Management Tools
        {
          name: 'set_file_approval',
          description: 'Set approval status for a file',
          inputSchema: {
            type: 'object',
            properties: {
              filePath: { type: 'string', description: 'Path to the file' },
              approvalType: { type: 'string', enum: ['devApproved', 'codeReviewApproved', 'qaApproved'] },
              approvedBy: { type: 'string', description: 'Who approved it' }
            },
            required: ['filePath', 'approvalType', 'approvedBy']
          }
        },
        {
          name: 'get_file_approval_status',
          description: 'Get approval status for a file',
          inputSchema: {
            type: 'object',
            properties: {
              filePath: { type: 'string', description: 'Path to the file' }
            },
            required: ['filePath']
          }
        },
    
        // Rule Engine Tools
        {
          name: 'check_before_modification',
          description: 'Check if a file can be modified according to AI metadata rules',
          inputSchema: {
            type: 'object',
            properties: {
              filePath: { type: 'string', description: 'Path to the file to check' }
            },
            required: ['filePath']
          }
        },
        {
          name: 'get_modification_actions',
          description: 'Get actions that should be taken after modifying a file',
          inputSchema: {
            type: 'object',
            properties: {
              filePath: { type: 'string', description: 'Path to the file' }
            },
            required: ['filePath']
          }
        },
    
        // Metadata Tools
        {
          name: 'parse_file_metadata',
          description: 'Parse AI metadata from a file',
          inputSchema: {
            type: 'object',
            properties: {
              filePath: { type: 'string', description: 'Path to the file' }
            },
            required: ['filePath']
          }
        },
        {
          name: 'update_file_metadata',
          description: 'Update AI metadata in a file',
          inputSchema: {
            type: 'object',
            properties: {
              filePath: { type: 'string', description: 'Path to the file' },
              updates: { type: 'object', description: 'Metadata updates to apply' }
            },
            required: ['filePath', 'updates']
          }
        },
        {
          name: 'find_files_with_metadata',
          description: 'Find all files that contain AI metadata',
          inputSchema: {
            type: 'object',
            properties: {
              pattern: { type: 'string', description: 'File pattern to search (optional)' }
            }
          }
        },
    
        // Changelog Tools
        {
          name: 'add_changelog_entry',
          description: 'Add an entry to the project changelog',
          inputSchema: {
            type: 'object',
            properties: {
              description: { type: 'string', description: 'Description of the change' },
              filesChanged: { type: 'array', items: { type: 'string' }, description: 'Files that were changed' },
              type: { type: 'string', enum: ['added', 'changed', 'deprecated', 'removed', 'fixed', 'security'] },
              breakingChange: { type: 'boolean', description: 'Whether this is a breaking change' },
              impact: { type: 'string', enum: ['major', 'minor', 'patch'] }
            },
            required: ['description', 'filesChanged', 'type']
          }
        },
        {
          name: 'get_file_changelog',
          description: 'Get changelog entries for a specific file',
          inputSchema: {
            type: 'object',
            properties: {
              filePath: { type: 'string', description: 'Path to the file' }
            },
            required: ['filePath']
          }
        },
        {
          name: 'get_recent_changes',
          description: 'Get recent changelog entries',
          inputSchema: {
            type: 'object',
            properties: {
              days: { type: 'number', description: 'Number of days to look back (default: 7)' }
            }
          }
        },
        
        // Folder Mapping Tools  
        {
          name: 'generate_folder_map',
          description: 'Generate or update a _map.md file for a specific folder',
          inputSchema: {
            type: 'object',
            properties: {
              folderPath: { type: 'string', description: 'Path to the folder to generate map for' }
            },
            required: ['folderPath']
          }
        },
        {
          name: 'generate_all_folder_maps', 
          description: 'Generate _map.md files for all folders in the project',
          inputSchema: {
            type: 'object',
            properties: {}
          }
        },
    
        // Git Tools
        {
          name: 'update_last_editor',
          description: 'Update @last-editor field in a file with Git author information',
          inputSchema: {
            type: 'object',
            properties: {
              filePath: { type: 'string', description: 'Path to the file to update' }
            },
            required: ['filePath']
          }
        },
        {
          name: 'update_all_last_editors',
          description: 'Update @last-editor fields in all files with Git author information',
          inputSchema: {
            type: 'object',
            properties: {}
          }
        },
        {
          name: 'get_file_last_editor',
          description: 'Get the last editor of a file from Git history',
          inputSchema: {
            type: 'object',
            properties: {
              filePath: { type: 'string', description: 'Path to the file' }
            },
            required: ['filePath']
          }
        }
      ]
    }));
  • Core logic for starting a new session: generates ID, updates project memory's currentSession with task details, persists to file, and returns session ID.
    async startNewSession(task: string): Promise<string> {
      const memory = await this.getProjectMemory();
      const sessionId = this.generateSessionId();
      
      memory.currentSession = {
        sessionId,
        task,
        started: new Date().toISOString(),
        completedSteps: [],
        nextSteps: [],
        importantDecisions: {},
        blockers: []
      };
    
      await this.saveProjectMemory(memory);
      console.log(chalk.blue(`๐Ÿš€ Started new session: ${sessionId}`));
      console.log(chalk.blue(`๐Ÿ“‹ Task: ${task}`));
      return sessionId;
    }
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 the tool starts a session but doesn't explain what that entailsโ€”e.g., whether it creates persistent state, requires authentication, has side effects like resource allocation, or what the expected outcome is. This leaves critical behavioral traits unspecified for a tool that likely initiates a process.

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

Conciseness5/5

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

The description is a single, clear sentence that directly states the tool's purpose without any fluff or redundancy. It is front-loaded with the essential information, making it highly efficient and easy to parse. Every word earns its place, contributing to understanding without waste.

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?

Given the complexity of starting a session (which likely involves state creation or initialization), the lack of annotations and output schema means the description is insufficient. It doesn't cover what the tool returns, potential errors, or behavioral details like session persistence. For a tool with no structured data to supplement it, this leaves significant gaps in understanding its full context.

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 schema description coverage is 100%, with the single parameter 'task' fully documented in the schema as 'Description of the task to work on'. The description adds no additional meaning beyond this, such as examples or constraints. 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 action ('Start') and resource ('new AI coding session') with a specific purpose ('with a specific task'). It distinguishes itself from siblings like 'add_session_step' by indicating it initiates a session rather than adding to an existing one. However, it doesn't explicitly contrast with all sibling tools, keeping it from a perfect score.

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, such as whether a session must be started before using tools like 'add_session_step', or when to choose this over other session-related tools. This lack of contextual direction leaves the agent without explicit usage cues.

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

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/keleshteri/mcp-memory'

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