Skip to main content
Glama

remove_memory

Remove specific memory entries from the agent's memory system by providing the memory ID, enabling precise memory management and data cleanup.

Instructions

Remove a memory entry from the agent memory system

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
memoryIdYesID of the memory entry to remove

Implementation Reference

  • The main handler function for the 'remove_memory' MCP tool. It receives the memoryId argument, calls ragService.removeMemory, and returns the result as a formatted text content block.
    private async handleRemoveMemory(args: { memoryId: string }) {
      const result = await this.ragService.removeMemory(args.memoryId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
  • src/index.ts:160-173 (registration)
    Registration of the 'remove_memory' tool in the MCP server's tools list, including name, description, and input schema.
    {
      name: 'remove_memory',
      description: 'Remove a memory entry from the agent memory system',
      inputSchema: {
        type: 'object',
        properties: {
          memoryId: {
            type: 'string',
            description: 'ID of the memory entry to remove',
          },
        },
        required: ['memoryId'],
      },
    },
  • Input schema definition for the 'remove_memory' tool, specifying the required memoryId parameter.
    inputSchema: {
      type: 'object',
      properties: {
        memoryId: {
          type: 'string',
          description: 'ID of the memory entry to remove',
        },
      },
      required: ['memoryId'],
  • Helper service method in RAGService that handles the actual memory removal by delegating to vectorDatabase.deleteMemory and provides success/error response.
    async removeMemory(memoryId: string): Promise<{
      success: boolean;
      message: string;
    }> {
      try {
        logger.info(`Removing memory entry: ${memoryId}`);
        
        await this.vectorDatabase.deleteMemory(memoryId);
        
        logger.info(`Successfully removed memory entry: ${memoryId}`);
        
        return {
          success: true,
          message: 'Memory removed successfully'
        };
      } catch (error) {
        logger.error(`Error removing memory: ${error}`);
        return {
          success: false,
          message: `Failed to remove memory: ${error}`
        };
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool removes a memory entry but doesn't clarify if this is permanent, reversible, requires specific permissions, or has side effects (e.g., affecting related data). This is a significant gap for a mutation tool with zero annotation coverage.

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, clear sentence that efficiently conveys the core action without unnecessary words. It's front-loaded with the essential information, making it easy to parse quickly, which is ideal for conciseness.

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?

Given the tool's complexity as a mutation operation with no annotations and no output schema, the description is incomplete. It doesn't address behavioral aspects like permanence, error handling, or what happens on success/failure, leaving gaps that could hinder an AI agent's ability to use it correctly.

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?

The description doesn't add any parameter-specific information beyond what's already in the input schema, which has 100% coverage for the single parameter 'memoryId'. The schema's description adequately explains this parameter, so the baseline score of 3 is appropriate as the description doesn't compensate but also doesn't detract.

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 ('remove') and resource ('memory entry from the agent memory system'), making the purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'remove_file' or 'clear_data' beyond mentioning the specific resource type, which prevents a perfect score.

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 like 'clear_data' (which might remove multiple entries) or 'remove_file' (for different resource types). It lacks context about prerequisites, such as needing a valid memory ID from prior operations like 'search_memory' or 'get_memory_by_agent'.

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/santis84/mcp-rag'

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