generate_session
Create structured Learning Hour sessions for Technical Coaches by specifying a topic, enabling deliberate practice and technical excellence.
Instructions
Generate comprehensive Learning Hour content for Technical Coaches
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | Yes | The learning topic (e.g., 'Feature Envy', 'DRY Principle') |
Implementation Reference
- src/index.ts:269-290 (handler)Main handler function for the generate_session tool. Parses input schema, calls the generator helper to produce session content, formats and returns the response as MCP content.public async generateSession(args: any) { const input = GenerateSessionInputSchema.parse(args); try { const sessionData = await this.generator.generateSessionContent(input.topic, input.style); return { content: [ { type: "text", text: `✅ Learning Hour session generated for: ${input.topic}`, }, { type: "text", text: JSON.stringify(sessionData, null, 2), }, ], }; } catch (error) { throw new Error(`Failed to generate session: ${error instanceof Error ? error.message : String(error)}`); } }
- src/index.ts:20-23 (schema)Zod input validation schema for generate_session tool parameters: required topic and optional style.const GenerateSessionInputSchema = z.object({ topic: z.string().min(1, "Topic is required"), style: z.string().optional().default('slide'), });
- src/index.ts:97-115 (registration)Tool registration in listTools handler, defining name, description, and inputSchema for generate_session.{ name: "generate_session", description: "Generate comprehensive Learning Hour content for Technical Coaches", inputSchema: { type: "object", properties: { topic: { type: "string", description: "The learning topic (e.g., 'Feature Envy', 'DRY Principle')", }, style: { type: "string", description: "Presentation style: slide (default), vertical, or workshop", default: "slide" }, }, required: ["topic"], }, },
- src/LearningHourGenerator.ts:383-408 (helper)Supporting helper in LearningHourGenerator class that generates the actual SessionContent using Anthropic Claude API call and prompt engineering.async generateSessionContent(topic: string, style: string = 'slide'): Promise<SessionContent> { const prompt = this.buildSessionPrompt(topic, style); try { const message = await this.client.messages.create({ model: this.model, max_tokens: 3000, messages: [{ role: 'user', content: prompt }] }); const textContent = message.content.find(block => block.type === 'text'); if (!textContent || textContent.type !== 'text') { throw new Error('No text content in response'); } const content = textContent.text; const sessionData = JSON.parse(content); this.validateSessionContent(sessionData); return sessionData; } catch (error) { throw new Error(`Failed to generate session: ${error instanceof Error ? error.message : String(error)}`); } }