Skip to main content
Glama

m9k_forget

DestructiveIdempotent

Remove specific data chunks from the memory index to manage stored information. Use after identifying chunk IDs with search to permanently delete indexed content.

Instructions

Permanently remove a specific chunk from the memory index. Does NOT delete the source JSONL. Use m9k_search() first to find the chunk ID to forget.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chunkIdYesChunk ID to permanently delete from the index

Implementation Reference

  • The tool 'm9k_forget' is registered and implemented within `registerManageTools` in `src/tools/manage.ts`. It performs a soft-delete of a chunk in the `conv_chunks` database table and hard-deletes associated vectors.
    server.registerTool(
      'm9k_forget',
      {
        description:
          'Permanently remove a specific chunk from the memory index. Does NOT delete the source JSONL. Use m9k_search() first to find the chunk ID to forget.',
        inputSchema: {
          chunkId: z.string().describe('Chunk ID to permanently delete from the index'),
        },
        annotations: {
          readOnlyHint: false,
          destructiveHint: true,
          idempotentHint: true,
          openWorldHint: false,
        },
      },
      async ({ chunkId }) => {
        // Check if chunk exists and is not already deleted
        const chunk = ctx.db
          .prepare('SELECT id, session_id FROM conv_chunks WHERE id = ? AND deleted_at IS NULL')
          .get(chunkId) as { id: string; session_id: string } | undefined;
    
        if (!chunk) {
          return {
            content: [
              {
                type: 'text' as const,
                text: JSON.stringify({ error: 'Chunk not found', chunkId }),
              },
            ],
            isError: true,
          };
        }
    
        // Soft-delete the chunk
        ctx.db
          .prepare("UPDATE conv_chunks SET deleted_at = datetime('now') WHERE id = ?")
          .run(chunkId);
    
        // Hard-delete associated vectors (no need to keep them)
        if (ctx.searchContext.vecTextEnabled) {
          deleteVectorsForChunk(ctx.db, chunkId, '_text');
        }
        if (ctx.searchContext.vecCodeEnabled) {
          deleteVectorsForChunk(ctx.db, chunkId, '_code');
        }
    
        return {
          content: [
            {
              type: 'text' as const,
              text: JSON.stringify({ forgotten: true, chunkId }),
            },
          ],
        };
      },
    );
Behavior4/5

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

While annotations cover destructive/idempotent status, the description adds crucial behavioral context: 'Does NOT delete the source JSONL,' clarifying the separation between index and storage—critical safety information beyond what annotations provide.

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 tightly constructed sentences: first states the action and critical limitation, second gives the prerequisite. Zero redundancy, front-loaded with essential information.

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

Completeness4/5

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

Given the single-parameter, destructive nature with no output schema, the description adequately covers the operation scope, safety caveats (JSONL preservation), and prerequisites. Could mention idempotency explicitly, but annotations cover this.

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 has 100% coverage describing 'chunkId' as the ID to delete. The description implies this parameter ('remove a specific chunk') but adds no syntax, format, or semantic details beyond the schema, warranting the baseline score for high-coverage schemas.

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?

The description uses specific verb 'remove' with resource 'chunk from the memory index' and explicitly distinguishes from source file deletion ('Does NOT delete the source JSONL'), clearly differentiating it from potential file-deletion siblings.

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 prerequisite: 'Use m9k_search() first to find the chunk ID.' Names the specific sibling tool (m9k_search) to use as prerequisite, making the decision path unambiguous.

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