Skip to main content
Glama

set_importance

Assign importance levels (critical, important, normal, temporary, deprecated) to entities to manage and prioritize them effectively within the Memento MCP 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)
    Registers the MCP 'set_importance' tool, including Zod input schema (entityName: string, importance: enum), description, and async handler that resolves via KnowledgeGraphManager and returns formatted JSON response.
    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 ) }] }) );
  • Core business logic for setImportance: looks up entityId by name, delegates to ContextManager (searchContextManager), handles errors and formats 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 ContextManager: validates importance against ImportanceLevel enum values, delegates to GraphRepository.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); }
  • SQLite GraphRepository implementation: SQL UPDATE on observations table to set importance for all observations of the entity.
    async setImportance(entityId, importance) { const result = await this.db.run( 'UPDATE observations SET importance = ? WHERE entity_id = ?', [importance, entityId] ); return result.changes > 0; }
  • PostgreSQL GraphRepository implementation: SQL UPDATE on observations table to set importance for all observations of 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