delete_temporal
Remove specific temporal data from the MemoryMesh knowledge graph by specifying its name. Ensures precise deletion of outdated or unnecessary entries.
Instructions
Delete an existing temporal from the knowledge graph
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| delete_temporal | Yes | Delete parameters for temporal |
Input Schema (JSON Schema)
{
"properties": {
"delete_temporal": {
"description": "Delete parameters for temporal",
"properties": {
"name": {
"description": "The name of the temporal to delete",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
},
"required": [
"delete_temporal"
],
"type": "object"
}
Implementation Reference
- Core handler function that performs the actual deletion of a 'temporal' node. Checks if the node exists in the graph, deletes it using ApplicationManager.deleteNodes, and returns formatted success/error response.export async function handleSchemaDelete( nodeName: string, nodeType: string, applicationManager: ApplicationManager ): Promise<ToolResponse> { try { const graph = await applicationManager.readGraph(); const node = graph.nodes.find((n: Node) => n.name === nodeName && n.nodeType === nodeType); if (!node) { return formatToolError({ operation: 'deleteSchema', error: `${nodeType} "${nodeName}" not found`, context: {nodeName, nodeType}, suggestions: ["Verify node name and type"] }); } await applicationManager.deleteNodes([nodeName]); return formatToolResponse({ actionTaken: `Deleted ${nodeType}: ${nodeName}` }); } catch (error) { return formatToolError({ operation: 'deleteSchema', error: error instanceof Error ? error.message : 'Unknown error occurred', context: {nodeName, nodeType}, suggestions: [ "Check node exists", "Verify delete permissions" ], recoverySteps: [ "Ensure no dependent nodes exist", "Try retrieving node first" ] }); } }
- Tool dispatch handler specific to delete_* tools. Extracts the node name from input arguments and calls the core handleSchemaDelete function.case 'delete': { const {name} = args[`delete_${schemaName}`]; if (!name) { return formatToolError({ operation: toolName, error: `Name is required to delete a ${schemaName}`, suggestions: ["Provide the 'name' parameter"] }); } return handleSchemaDelete(name, schemaName, knowledgeGraphManager); }
- Dynamically generates the input schema and tool definition for delete_temporal, requiring a 'name' parameter within a delete_temporal object.const deleteSchema: Tool = { name: `delete_${schemaName}`, description: `Delete an existing ${schemaName} from the knowledge graph`, inputSchema: { type: "object", properties: { [`delete_${schemaName}`]: { type: "object", description: `Delete parameters for ${schemaName}`, properties: { name: { type: "string", description: `The name of the ${schemaName} to delete` } }, required: ["name"] } }, required: [`delete_${schemaName}`] } }; tools.push(deleteSchema);
- src/integration/tools/DynamicSchemaToolRegistry.ts:67-70 (registration)Registers all dynamically generated schema tools (including delete_temporal for temporal schema) by adding them to the internal toolsCache Map, making them available via getTools().for (const [schemaName, schema] of this.schemas.entries()) { const tools = await this.generateToolsForSchema(schemaName, schema); tools.forEach(tool => this.toolsCache.set(tool.name, tool)); }