Skip to main content
Glama
T1nker-1220

Knowledge Graph Memory Server

delete_relations

Remove specific connections between entities in the knowledge graph to maintain accurate relationship data and eliminate outdated or incorrect associations.

Instructions

Delete multiple relations from the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
relationsYesAn array of relations to delete

Implementation Reference

  • The main handler function in KnowledgeGraphManager that deletes the specified relations from the graph by filtering them out and saving the updated graph.
    async deleteRelations(relations: Relation[]): Promise<void> { const graph = await this.loadGraph(); graph.relations = graph.relations.filter(r => !relations.some(delRelation => r.from === delRelation.from && r.to === delRelation.to && r.relationType === delRelation.relationType )); await this.saveGraph(graph); }
  • The input schema defining the expected parameters for the delete_relations tool: an array of relations with from, to, and relationType.
    inputSchema: { type: "object", properties: { relations: { type: "array", items: { type: "object", properties: { from: { type: "string", description: "The name of the entity where the relation starts" }, to: { type: "string", description: "The name of the entity where the relation ends" }, relationType: { type: "string", description: "The type of the relation" }, }, required: ["from", "to", "relationType"], }, description: "An array of relations to delete" }, }, required: ["relations"], },
  • index.ts:1039-1061 (registration)
    Registration of the delete_relations tool in the list of tools returned by ListToolsRequestSchema.
    { name: "delete_relations", description: "Delete multiple relations from the knowledge graph", inputSchema: { type: "object", properties: { relations: { type: "array", items: { type: "object", properties: { from: { type: "string", description: "The name of the entity where the relation starts" }, to: { type: "string", description: "The name of the entity where the relation ends" }, relationType: { type: "string", description: "The type of the relation" }, }, required: ["from", "to", "relationType"], }, description: "An array of relations to delete" }, }, required: ["relations"], }, },
  • index.ts:1235-1237 (registration)
    The switch case in CallToolRequestSchema handler that routes calls to delete_relations to the KnowledgeGraphManager method.
    case "delete_relations": await knowledgeGraphManager.deleteRelations(args.relations as Relation[]); return { content: [{ type: "text", text: "Relations deleted 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