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;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. While 'Set' implies a mutation operation, the description doesn't address critical behavioral aspects: whether this requires specific permissions, if changes are reversible, what happens to existing importance levels, error conditions, or response format. For a mutation tool with zero annotation coverage, this represents a significant transparency gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the core functionality without unnecessary words. It's front-loaded with the primary action and includes the complete enum list for immediate clarity. Every element serves a purpose with zero waste, making it optimally concise for this tool's scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is insufficiently complete. It doesn't address the mutation's consequences, error handling, permissions requirements, or what the tool returns. While the schema covers parameters well, the behavioral and operational context needed for safe, effective use is largely missing, making this description inadequate for the tool's complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters clearly documented in the schema. The description adds minimal value beyond the schema by mentioning the five enum values, but doesn't provide additional semantic context (e.g., what 'deprecated' means operationally, how 'temporary' differs from 'normal'). With complete schema documentation, the baseline score of 3 is appropriate as the description doesn't significantly enhance parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Set') and resource ('importance level for an entity'), specifying the exact verb and target. It distinguishes from siblings like 'create_entities' or 'delete_entities' by focusing on updating importance rather than creating/deleting entities. However, it doesn't explicitly differentiate from tools like 'add_observations' or 'search_nodes' in terms of when to use this specific importance-setting function.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., entity must exist), exclusions (e.g., cannot set importance for non-existent entities), or contextual cues (e.g., use after entity creation, before deletion). With multiple sibling tools available, this lack of usage context leaves the agent guessing about appropriate application scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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