set_importance
Assign importance levels (critical, important, normal, temporary, deprecated) to entities for prioritization and management within the Memento memory server.
Instructions
Set the importance level for an entity (critical, important, normal, temporary, deprecated).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entityName | Yes | Name of the entity. | |
| importance | Yes | Importance level for the entity. |
Implementation Reference
- src/server.js:222-240 (registration)MCP tool registration for 'set_importance', including schema (entityName string, importance enum), description, and handler function that delegates to KnowledgeGraphManager.setImportance and returns JSON-formatted result.this.tool( 'set_importance', 'Set the importance level for an entity (critical, important, normal, temporary, deprecated).', { entityName: z.string().describe('Name of the entity.'), importance: z.enum(['critical', 'important', 'normal', 'temporary', 'deprecated']) .describe('Importance level for the entity.') }, async ({ entityName, importance }) => ({ content: [{ type: 'text', text: JSON.stringify( await this.#knowledgeGraphManager.setImportance(entityName, importance), null, 2 ) }] }) );
- src/knowledge-graph-manager.js:326-348 (handler)Handler in KnowledgeGraphManager that resolves entityName to entityId, calls SearchContextManager.setImportance, and returns structured success/error response.async setImportance(entityName, importance) { try { const entityId = await this.getEntityId(entityName); if (!entityId) { return { success: false, error: `Entity "${entityName}" not found` }; } const success = await this.#searchContextManager.setImportance(entityId, importance); return { success, entityName, importance, message: success ? `Importance set to '${importance}' for entity '${entityName}'` : `Failed to set importance for entity '${entityName}'` }; } catch (error) { return { success: false, error: error.message }; } }
- src/context-manager.js:587-595 (helper)Helper in SearchContextManager (context-manager.js) that validates importance level against enum and delegates to repository.setImportance.async setImportance(entityId, importance) { const validLevels = Object.values(ImportanceLevel); if (!validLevels.includes(importance)) { throw new Error(`Invalid importance level: ${importance}. Use ImportanceLevel enum values.`); } return this.#repository.setImportance(entityId, importance); }
- src/graph-repository.js:40-40 (schema)Interface definition (JSDoc) for GraphRepository.setImportance method signature.* @property {(entityId: number|string, importance: string) => Promise<boolean>} setImportance
- src/postgres/graph-repo.js:509-518 (helper)PostgreSQL repository implementation of setImportance: SQL UPDATE on observations table for the entity.async setImportance(entityId, importance) { const rows = await this.#query( `UPDATE observations SET importance = $1 WHERE entity_id = $2 RETURNING id`, [ importance, entityId ] ); return rows.length > 0; }