Skip to main content
Glama
T1nker-1220

Knowledge Graph Memory Server

update_lesson_success

Update lesson success rates in a knowledge graph memory system to track solution effectiveness and improve future interactions.

Instructions

Update the success rate of a lesson after applying its solution

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
lessonNameYesName of the lesson to update
successYesWhether the solution was successful

Implementation Reference

  • The handler function in KnowledgeGraphManager that finds the lesson by name, updates its metadata with new frequency and success rate based on the provided success boolean, and saves the graph.
    async updateLessonSuccess(lessonName: string, success: boolean): Promise<void> { const graph = await this.loadGraph(); const lesson = graph.entities.find(e => e.name === lessonName && e.entityType === 'lesson') as LessonEntity | undefined; if (!lesson) { throw new Error(`Lesson with name ${lessonName} not found`); } if (!lesson.metadata) { lesson.metadata = { createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), frequency: 0, successRate: 0 }; } const currentSuccessRate = lesson.metadata.successRate ?? 0; const frequency = lesson.metadata.frequency ?? 0; lesson.metadata.frequency = frequency + 1; lesson.metadata.successRate = ((currentSuccessRate * frequency) + (success ? 1 : 0)) / (frequency + 1); lesson.metadata.updatedAt = new Date().toISOString(); await this.saveGraph(graph); }
  • The input schema for the update_lesson_success tool, defining lessonName (string) and success (boolean) as required parameters.
    name: "update_lesson_success", description: "Update the success rate of a lesson after applying its solution", inputSchema: { type: "object", properties: { lessonName: { type: "string", description: "Name of the lesson to update" }, success: { type: "boolean", description: "Whether the solution was successful" } }, required: ["lessonName", "success"] } },
  • index.ts:1248-1250 (registration)
    The dispatch case in the CallToolRequestHandler switch statement that calls the handler on knowledgeGraphManager and returns success message.
    case "update_lesson_success": await knowledgeGraphManager.updateLessonSuccess(args.lessonName as string, args.success as boolean); return { content: [{ type: "text", text: "Lesson success updated successfully" }] };

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/T1nker-1220/memories-with-lessons-mcp-server'

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