find_similar_errors
Identify and resolve recurring errors by analyzing past issues stored in a knowledge graph. Input error details to receive similar errors and their proven solutions.
Instructions
Find similar errors and their solutions in the knowledge graph
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| errorPattern | Yes |
Implementation Reference
- index.ts:799-816 (handler)Core handler function in KnowledgeGraphManager that filters lesson entities from the graph matching the input errorPattern by type equality, message substring match (case-insensitive), or exact context match, then sorts by descending successRate.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 ListToolsRequestSchema response, including name, description, and input schema definition.{ 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"] } },
- index.ts:1246-1247 (handler)Dispatcher in CallToolRequestSchema handler that invokes the KnowledgeGraphManager.findSimilarErrors method with tool arguments and formats the response.case "find_similar_errors": return { content: [{ type: "text", text: JSON.stringify(await knowledgeGraphManager.findSimilarErrors(args.errorPattern as ErrorPattern), null, 2) }] };
- index.ts:1169-1183 (schema)JSON Schema defining the input parameters for the find_similar_errors tool: an errorPattern object with type, message, and context fields.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"] }