Skip to main content
Glama

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
NameRequiredDescriptionDefault
entityNameYesName of the entity.
importanceYesImportance 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 ) }] }) );
  • 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 }; } }
  • 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); }
  • Interface definition (JSDoc) for GraphRepository.setImportance method signature.
    * @property {(entityId: number|string, importance: string) => Promise<boolean>} setImportance
  • 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; }

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/iAchilles/memento'

If you have feedback or need assistance with the MCP directory API, please join our Discord server