Skip to main content
Glama
T1nker-1220

Knowledge Graph Memory Server

update_lesson_success

Track and update lesson success rates in the Knowledge Graph Memory Server to improve solution accuracy and enhance learning from past 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 main handler function in KnowledgeGraphManager that updates the success rate and frequency metadata for a specific lesson based on whether the solution was successful.
    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 definition for the update_lesson_success tool, specifying 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 switch case in the CallToolRequestSchema handler that registers and dispatches calls to the updateLessonSuccess handler.
    case "update_lesson_success": await knowledgeGraphManager.updateLessonSuccess(args.lessonName as string, args.success as boolean); return { content: [{ type: "text", text: "Lesson success updated successfully" }] };

Other Tools

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

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