Skip to main content
Glama
T1nker-1220

Knowledge Graph Memory Server

find_similar_errors

Locate similar errors and their solutions in the knowledge graph by analyzing error patterns, types, messages, and context to resolve recurring issues.

Instructions

Find similar errors and their solutions in the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
errorPatternYes

Implementation Reference

  • The main handler function in KnowledgeGraphManager that executes the find_similar_errors tool logic by filtering and sorting lesson entities based on similarity to the provided error pattern.
    async findSimilarErrors(errorPattern: ErrorPattern): Promise<LessonEntity[]> { const graph = await this.loadGraph(); return graph.entities .filter((e): e is LessonEntity => { if (e.entityType !== 'lesson') return false; const lessonEntity = e as Partial<LessonEntity>; return ( lessonEntity.errorPattern !== undefined && ( lessonEntity.errorPattern.type === errorPattern.type || lessonEntity.errorPattern.message.toLowerCase().includes(errorPattern.message.toLowerCase()) || lessonEntity.errorPattern.context === errorPattern.context ) ); }) .sort((a, b) => (b.metadata?.successRate ?? 0) - (a.metadata?.successRate ?? 0)); }
  • index.ts:1166-1184 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    { name: "find_similar_errors", description: "Find similar errors and their solutions in the knowledge graph", inputSchema: { type: "object", properties: { errorPattern: { type: "object", properties: { type: { type: "string", description: "Category of the error" }, message: { type: "string", description: "The error message" }, context: { type: "string", description: "Where the error occurred" } }, required: ["type", "message", "context"] } }, required: ["errorPattern"] } },
  • TypeScript interface defining the input structure for the error pattern used by the tool.
    interface ErrorPattern { type: string; message: string; context: string; stackTrace?: string; }
  • Dispatcher in the CallToolRequest handler that invokes the findSimilarErrors method with the tool arguments.
    case "find_similar_errors": return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.findSimilarErrors(args.errorPattern as ErrorPattern), null, 2) }] };
  • TypeScript interface defining the structure of lesson entities returned by the tool.
    interface LessonEntity extends Entity { errorPattern: ErrorPattern; metadata: Metadata; verificationSteps: VerificationStep[]; }

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