Skip to main content
Glama

m9k_save

Idempotent

Save memory notes for important decisions, patterns, or context using the Melchizedek MCP server's persistent memory system. Organize with tags for future recall.

Instructions

Manually save a memory note for future recall. Use for important decisions, patterns, or context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesThe memory content to save
tagsNoOptional tags for categorization

Implementation Reference

  • The handler logic for the 'm9k_save' tool, which saves memory notes to a SQLite database.
      async ({ content, tags }) => {
        const MANUAL_SESSION_ID = '__manual_memories__';
    
        // Ensure the manual memories session exists
        const existingSession = ctx.db
          .prepare('SELECT id FROM conv_sessions WHERE id = ?')
          .get(MANUAL_SESSION_ID) as { id: string } | undefined;
    
        if (!existingSession) {
          ctx.db
            .prepare(
              `INSERT INTO conv_sessions (id, project, jsonl_path, file_hash, file_size, started_at, message_count, chunk_count)
             VALUES (?, ?, ?, ?, ?, datetime('now'), 0, 0)`,
            )
            .run(MANUAL_SESSION_ID, '__global__', '__manual__', '', 0);
        }
    
        const hash = crypto.createHash('sha256').update(content).digest('hex');
        const chunkId = `mem:${hash.slice(0, 12)}`;
        const tagsJson = tags && tags.length > 0 ? JSON.stringify(tags) : null;
    
        // INSERT OR IGNORE for dedup by hash
        const result = ctx.db
          .prepare(
            `INSERT OR IGNORE INTO conv_chunks (id, session_id, idx, kind, user_content, assistant_content, hash, timestamp, token_count, tags, metadata_json)
           VALUES (?, ?, 0, ?, ?, '', ?, datetime('now'), ?, ?, '{}')`,
          )
          .run(
            chunkId,
            MANUAL_SESSION_ID,
            CONV_KIND_MEMORY,
            content,
            hash,
            Math.ceil(content.length / 4),
            tagsJson,
          );
    
        // Update session chunk count
        ctx.db
          .prepare(
            `UPDATE conv_sessions SET chunk_count = (SELECT COUNT(*) FROM conv_chunks WHERE session_id = ?) WHERE id = ?`,
          )
          .run(MANUAL_SESSION_ID, MANUAL_SESSION_ID);
    
        const saved = result.changes > 0;
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify({ saved, chunkId, duplicate: !saved }),
            },
          ],
        };
      },
    );
  • Registration of the 'm9k_save' tool including its input schema and annotations.
    server.registerTool(
      'm9k_save',
      {
        description:
          'Manually save a memory note for future recall. Use for important decisions, patterns, or context.',
        inputSchema: {
          content: z.string().describe('The memory content to save'),
          tags: z.array(z.string()).optional().describe('Optional tags for categorization'),
        },
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
Behavior3/5

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

The description aligns with annotations (acknowledging it's a write operation with 'save') and adds qualitative context about what constitutes valuable content (decisions/patterns). With idempotentHint=true already declared, the description doesn't need to repeat safety details, though it could have clarified overwrite behavior or persistence guarantees.

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?

Two sentences with zero waste: first defines the action, second defines the use case. Front-loaded with the verb 'save' and no filler text. Every word earns its place.

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

Completeness3/5

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

Adequate for a simple 2-parameter write tool with good annotations, but lacks information about what the tool returns (success indicator, ID, etc.) given no output schema exists. No mention of persistence scope or session vs global storage.

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?

With 100% schema description coverage, the schema already documents both parameters adequately. The description implicitly maps to the 'content' parameter via 'memory note' but doesn't add syntactic guidance or examples beyond the schema. Baseline 3 is appropriate for high schema coverage.

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 ('save a memory note') and purpose ('for future recall'), distinguishing it from retrieval siblings like m9k_search or m9k_context. However, the modifier 'manually' is left unexplained (as opposed to what automatic mechanism?), slightly weakening the clarity.

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

Usage Guidelines3/5

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

It provides concrete use cases ('important decisions, patterns, or context') that help the agent identify appropriate scenarios. However, it lacks explicit guidance on when NOT to use this tool or which sibling to prefer (e.g., m9k_context vs m9k_save) for different types of memory storage.

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/louis49/melchizedek'

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