Skip to main content
Glama

start_session

Initiate a development session with Hi-AI to restore context, load project memories, and access coding guides for AI-assisted programming tasks.

Instructions

hi-ai|hello|start|begin session - Start session with context

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
greetingNoGreeting message that triggered this action (e.g., "hi-ai", "hello")
loadMemoryNoLoad relevant project memories (default: true)
loadGuidesNoLoad applicable coding guides (default: true)
restoreContextNoRestore previous session context (default: true)

Implementation Reference

  • The async handler function `startSession` that implements the core logic for the `start_session` tool. It loads project memories, coding guides, and previous session context based on input parameters, constructs a session summary, and returns it as a ToolResult.
    export async function startSession(args: { greeting?: string; loadMemory?: boolean; loadGuides?: boolean; restoreContext?: boolean }): Promise<ToolResult> {
      const { greeting = '', loadMemory = true, loadGuides: shouldLoadGuides = true, restoreContext = true } = args;
    
      try {
        const memoryManager = MemoryManager.getInstance();
        let summary = `${greeting ? greeting + '! ' : ''}Session started.\n`;
    
        // Load relevant project memories
        if (loadMemory) {
          const projectMemories = memoryManager.list('project');
          const codeMemories = memoryManager.list('code');
          const memories = [...projectMemories, ...codeMemories].slice(0, 5);
    
          if (memories.length > 0) {
            summary += `\nRecent Project Info:\n`;
            memories.forEach(mem => {
              const preview = mem.value.substring(0, 80);
              summary += `  • ${mem.key}: ${preview}${mem.value.length > 80 ? '...' : ''}\n`;
            });
          }
        }
    
        // Load coding guides
        if (shouldLoadGuides) {
          const allGuides = await loadGuides();
          const guides = allGuides
            .sort((a, b) => new Date(b.lastUpdated).getTime() - new Date(a.lastUpdated).getTime())
            .slice(0, 3);
    
          if (guides.length > 0) {
            summary += `\nActive Coding Guides:\n`;
            guides.forEach(guide => {
              summary += `  • ${guide.name} (${guide.category}): ${guide.description}\n`;
            });
          }
        }
    
        // Restore context
        if (restoreContext) {
          const contextMemories = memoryManager.list('context').slice(0, 3);
    
          if (contextMemories.length > 0) {
            summary += `\nPrevious Context:\n`;
            contextMemories.forEach(ctx => {
              try {
                const data = JSON.parse(ctx.value);
                summary += `  • ${data.urgency?.toUpperCase() || 'MEDIUM'} priority from ${new Date(ctx.timestamp).toLocaleString()}\n`;
              } catch {
                summary += `  • Context from ${new Date(ctx.timestamp).toLocaleString()}\n`;
              }
            });
          }
        }
    
        summary += '\nReady to continue development! What would you like to work on?';
    
        return {
          content: [{ type: 'text', text: summary }]
        };
      } catch (error) {
        return {
          content: [{ type: 'text', text: `${greeting ? greeting + '! ' : ''}Session started.\n\nReady to begin! What can I help you with?` }]
        };
      }
    }
  • The `ToolDefinition` object `startSessionDefinition` defining the `start_session` tool, including name, description, inputSchema with parameters like greeting, loadMemory, loadGuides, restoreContext, and annotations.
    export const startSessionDefinition: ToolDefinition = {
      name: 'start_session',
      description: 'hi-ai|hello|start|begin session - Start session with context',
      inputSchema: {
        type: 'object',
        properties: {
          greeting: { type: 'string', description: 'Greeting message that triggered this action (e.g., "hi-ai", "hello")' },
          loadMemory: { type: 'boolean', description: 'Load relevant project memories (default: true)' },
          loadGuides: { type: 'boolean', description: 'Load applicable coding guides (default: true)' },
          restoreContext: { type: 'boolean', description: 'Restore previous session context (default: true)' }
        },
        required: []
      },
      annotations: {
        title: 'Start Session',
        audience: ['user', 'assistant']
      }
    };
  • src/index.ts:654-655 (registration)
    Registration of the `start_session` tool in the main switch statement that dispatches tool calls to the `startSession` handler function.
    case 'start_session':
      return await startSession(args as any) as CallToolResult;
  • src/index.ts:134-134 (registration)
    Inclusion of `startSessionDefinition` in the `tools` array for tool listing and discovery.
    startSessionDefinition,
  • src/index.ts:67-67 (registration)
    Import statement bringing in `startSession` handler and `startSessionDefinition` schema from the tool file.
    import { startSession, startSessionDefinition } from './tools/memory/startSession.js';
Behavior3/5

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

Annotations only provide a title ('Start Session'), so the description carries the full burden of behavioral disclosure. It mentions 'Start session with context', implying initialization and context loading, but doesn't detail what 'context' includes, whether this is a read or write operation, or any side effects like authentication needs or rate limits. It adds minimal value beyond the title, but doesn't contradict annotations.

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

Conciseness2/5

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

The description is poorly structured and not front-loaded. It starts with confusing pipe-separated terms ('hi-ai|hello|start|begin session') before stating the purpose, which wastes space and could mislead. While brief, this inefficiency reduces clarity, making it less helpful for an agent.

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 no output schema and minimal annotations, the description is incomplete. It doesn't explain what the tool returns, how 'context' is defined, or the implications of starting a session (e.g., session ID, duration, or interaction with other tools). For a tool with 4 parameters and no structured output info, this leaves significant gaps in understanding.

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?

Schema description coverage is 100%, so the schema already documents all four parameters (greeting, loadMemory, loadGuides, restoreContext) with clear descriptions. The description adds no additional meaning about parameters beyond implying 'greeting' through 'hi-ai|hello|start|begin session', which is redundant. Baseline 3 is appropriate as the schema does the heavy lifting.

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

Purpose3/5

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

The description states the tool's purpose with 'Start session with context', which is a clear verb+resource combination. However, it begins with ambiguous terms like 'hi-ai|hello|start|begin session' that could confuse the agent about whether these are synonyms or parameters, and it doesn't differentiate from sibling tools like 'restore_session_context' or 'auto_save_context', leaving the scope vague.

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, timing, or comparisons to siblings such as 'restore_session_context' or 'auto_save_context', which might handle similar session-related tasks. This lack of context makes it hard for an agent to decide when this tool is appropriate.

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/ssdeanx/ssd-ai'

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