Skip to main content
Glama

generate_session

Create structured Learning Hour content for Technical Coaches to facilitate deliberate practice sessions on technical topics like Feature Envy or DRY Principle.

Instructions

Generate comprehensive Learning Hour content for Technical Coaches

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topicYesThe learning topic (e.g., 'Feature Envy', 'DRY Principle')
styleNoPresentation style: slide (default), vertical, or workshopslide

Implementation Reference

  • The primary handler method for the 'generate_session' MCP tool. Parses input arguments using Zod schema, delegates to LearningHourGenerator.generateSessionContent, and returns formatted content block.
    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:97-115 (registration)
    Tool registration in ListToolsRequestHandler. Defines name, description, and input schema for the MCP server.
    { 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"], }, },
  • Zod schema used for input validation in the generateSession handler.
    const GenerateSessionInputSchema = z.object({ topic: z.string().min(1, "Topic is required"), style: z.string().optional().default('slide'), });
  • Core implementation that generates session content by constructing a detailed prompt and calling the Anthropic Claude API. This is the actual logic execution delegated from the MCP handler.
    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)}`); } }
  • TypeScript interface defining the structure of the SessionContent returned by generateSessionContent.
    export interface SessionContent { topic: string; sessionOverview: string; learningObjectives: string[]; activities: LearningActivity[]; discussionPrompts: string[]; keyTakeaways: string[]; miroContent: MiroContent; }

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/SDiamante13/learning-hour-mcp'

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