Skip to main content
Glama

__USAGE_GUIDE

Read-onlyIdempotent

Access the usage guide for Melchizedek's persistent memory tools to search past conversations, manage indexed sessions, and configure the MCP server.

Instructions

melchizedek v1.0.2 — Persistent memory for Claude Code with hybrid search (BM25 + dual embeddings) + reranking.

Corpus: empty (no sessions indexed yet).

Available tools (16):

  • m9k_search: Find past conversations (BM25 + text vectors + code vectors, fused via RRF)

  • m9k_context: Get a chunk with surrounding conversation context

  • m9k_full: Get complete chunk content by IDs

  • m9k_sessions: Browse indexed sessions

  • m9k_file_history: Find conversations that touched a specific file

  • m9k_errors: Find past solutions for error messages

  • m9k_save: Store important notes for future recall

  • m9k_similar_work: Find past approaches to similar tasks (bonus for complex work)

  • m9k_forget: Permanently remove a chunk from memory

  • m9k_info: Memory index information, corpus size, search pipeline status, usage metrics, embedding worker state

  • m9k_config: View or update plugin configuration

  • m9k_delete_session: Remove a session from the index

  • m9k_ignore_project: Exclude a project from indexing (optionally purge existing data)

  • m9k_unignore_project: Re-enable indexing for a previously ignored project

  • m9k_restart: Restart the MCP server to load fresh code after rebuild

RETRIEVAL PATTERN (use this order):

  1. m9k_search(query) → compact results, current project and session boosted (use order="date_asc" to find first occurrence)

  2. m9k_context(chunkId) → surrounding conversation

  3. m9k_full([chunkIds]) → complete content if needed

SPECIALIZED SEARCH:

  • m9k_file_history(filePath) → before modifying any file

  • m9k_errors(errorMessage) → when you hit an error

  • m9k_similar_work(description) → at the start of a complex task

MANAGE:

  • m9k_info() → check corpus size, search pipeline, usage metrics

  • m9k_config() → view or change plugin configuration

  • m9k_delete_session(sessionId) → remove a session from the index

  • m9k_ignore_project(project) → exclude a project from indexing

  • m9k_unignore_project(project) → re-enable indexing for a project

  • m9k_restart() → restart server after npm run build

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler and registration logic for the '__USAGE_GUIDE' tool. It is a phantom tool whose implementation simply returns a fixed text explaining that its description is the guide.
    server.registerTool(
      '__USAGE_GUIDE',
      {
        description: usageGuideDescription,
        inputSchema: {},
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
      async () => {
        return {
          content: [
            {
              type: 'text' as const,
              text: 'This is a phantom tool. Its description above IS the usage guide.',
            },
          ],
        };
      },
    );
  • Helper function 'buildUsageGuide' that constructs the detailed text description used by the tool.
    export function buildUsageGuide(db: DatabaseType, version: string): string {
      const sessions = (
        db.prepare('SELECT COUNT(*) AS cnt FROM conv_sessions WHERE deleted_at IS NULL').get() as {
          cnt: number;
        }
      ).cnt;
      const chunks = (
        db.prepare('SELECT COUNT(*) AS cnt FROM conv_chunks WHERE deleted_at IS NULL').get() as {
          cnt: number;
        }
      ).cnt;
      const projects = (
        db
          .prepare('SELECT COUNT(DISTINCT project) AS cnt FROM conv_sessions WHERE deleted_at IS NULL')
          .get() as { cnt: number }
      ).cnt;
    
      const searchCount = parseInt(getStat(db, 'search_count') ?? '0', 10);
      const tokensServed = parseInt(getStat(db, 'tokens_served') ?? '0', 10);
    
      const statsLine =
        sessions > 0
          ? `\nCorpus: ${sessions} sessions, ${chunks} chunks across ${projects} projects.`
          : '\nCorpus: empty (no sessions indexed yet).';
    
      const usageLine =
        searchCount > 0 ? `\nUsage: ${searchCount} searches, ${tokensServed} tokens served.` : '';
    
      return `melchizedek v${version} — Persistent memory for Claude Code with hybrid search (BM25 + dual embeddings) + reranking.
    ${statsLine}${usageLine}
    
    Available tools (16):
    - m9k_search: Find past conversations (BM25 + text vectors + code vectors, fused via RRF)
    - m9k_context: Get a chunk with surrounding conversation context
    - m9k_full: Get complete chunk content by IDs
    - m9k_sessions: Browse indexed sessions
    - m9k_file_history: Find conversations that touched a specific file
    - m9k_errors: Find past solutions for error messages
    - m9k_save: Store important notes for future recall
    - m9k_similar_work: Find past approaches to similar tasks (bonus for complex work)
    - m9k_forget: Permanently remove a chunk from memory
    - m9k_info: Memory index information, corpus size, search pipeline status, usage metrics, embedding worker state
    - m9k_config: View or update plugin configuration
    - m9k_delete_session: Remove a session from the index
    - m9k_ignore_project: Exclude a project from indexing (optionally purge existing data)
    - m9k_unignore_project: Re-enable indexing for a previously ignored project
    - m9k_restart: Restart the MCP server to load fresh code after rebuild
    
    RETRIEVAL PATTERN (use this order):
    1. m9k_search(query) → compact results, current project and session boosted (use order="date_asc" to find first occurrence)
    2. m9k_context(chunkId) → surrounding conversation
    3. m9k_full([chunkIds]) → complete content if needed
    
    SPECIALIZED SEARCH:
    - m9k_file_history(filePath) → before modifying any file
    - m9k_errors(errorMessage) → when you hit an error
    - m9k_similar_work(description) → at the start of a complex task
    
    MANAGE:
    - m9k_info() → check corpus size, search pipeline, usage metrics
    - m9k_config() → view or change plugin configuration
    - m9k_delete_session(sessionId) → remove a session from the index
    - m9k_ignore_project(project) → exclude a project from indexing
    - m9k_unignore_project(project) → re-enable indexing for a project
    - m9k_restart() → restart server after npm run build`;
    }
  • Registration wrapper function for the usage guide tool.
    export function registerUsageGuide(server: McpServer, ctx: ToolContext): void {
      const usageGuideDescription = buildUsageGuide(ctx.db, ctx.version);
    
      server.registerTool(
        '__USAGE_GUIDE',
        {
          description: usageGuideDescription,
          inputSchema: {},
          annotations: {
            readOnlyHint: true,
            destructiveHint: false,
            idempotentHint: true,
            openWorldHint: false,
          },
        },
        async () => {
          return {
            content: [
              {
                type: 'text' as const,
                text: 'This is a phantom tool. Its description above IS the usage guide.',
              },
            ],
          };
        },
      );
    }
Behavior4/5

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

Annotations declare readOnly/idempotent/non-destructive. Description adds valuable runtime state ('Corpus: empty'), search methodology details (BM25 + dual embeddings + reranking), and persistence characteristics beyond the annotations.

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

Conciseness4/5

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

Lengthy but appropriately so for a documentation tool covering 16 siblings. Well-structured with clear headers (Available tools, RETRIEVAL PATTERN, SPECIALIZED SEARCH, MANAGE) enabling quick scanning. No redundant sentences.

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

Completeness5/5

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

Exhaustively complete for a zero-parameter meta-tool: documents entire tool ecosystem, provides workflows, lists all sibling functions with usage contexts, and describes current system state. No output schema needed as content is self-describing.

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

Parameters4/5

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

Input schema has zero parameters with 100% coverage of the empty set. Baseline 4 applies as there are no parameters requiring semantic clarification in the description text.

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

Purpose5/5

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

Description clearly identifies this as the usage guide/entry point for the melchizedek memory system ('Persistent memory for Claude Code...'), distinguishing it from operational siblings by listing all 16 available tools and their specific roles.

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

Usage Guidelines5/5

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

Provides explicit workflow patterns ('RETRIEVAL PATTERN (use this order)'): step 1 use m9k_search, step 2 m9k_context, step 3 m9k_full. Also categorizes when to use specialized searches ('before modifying any file', 'when you hit an error') and management operations.

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