Skip to main content
Glama

agentbay_memory_forget

Archive or permanently delete specific memory entries within a project. Supports single or batch removal, with hard delete option for permanent erasure.

Instructions

Archive (soft delete) or permanently delete memory entries

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID
knowledgeIdNoSingle entry ID
knowledgeIdsNoMultiple entry IDs
hardDeleteNoPermanently delete instead of archive (default: false)

Implementation Reference

  • The handler function for 'agentbay_memory_forget'. It accepts projectId, optional knowledgeId (single entry), knowledgeIds (multiple entries), and hardDelete flag. It constructs the request body and calls DELETE /api/v1/projects/{projectId}/memory via the apiDelete helper. Returns the result indicating archive (soft delete) or permanent deletion.
    // Tool 22: Memory Forget
    server.tool(
      'agentbay_memory_forget',
      'Archive (soft delete) or permanently delete memory entries',
      {
        projectId: z.string().describe('Project ID'),
        knowledgeId: z.string().optional().describe('Single entry ID'),
        knowledgeIds: z.array(z.string()).optional().describe('Multiple entry IDs'),
        hardDelete: z.boolean().optional().describe('Permanently delete instead of archive (default: false)'),
      },
      async ({ projectId, knowledgeId, knowledgeIds, hardDelete }) => {
        const body: Record<string, unknown> = {};
        if (knowledgeId) body.knowledgeId = knowledgeId;
        if (knowledgeIds) body.knowledgeIds = knowledgeIds;
        if (hardDelete) body.hardDelete = true;
    
        const data = await apiDelete(`/api/v1/projects/${projectId}/memory`, body);
        if (data.error) return { content: [{ type: 'text' as const, text: `Error: ${data.error}` }] };
        return { content: [{ type: 'text' as const, text: data.deleted ? `Deleted ${data.deleted} entries` : `Archived ${data.archived} entries` }] };
      }
    );
  • src/index.ts:706-706 (registration)
    Registration of the 'agentbay_memory_forget' tool via server.tool() with name 'agentbay_memory_forget'.
    server.tool(
  • Zod schema defining the input parameters: projectId (string), knowledgeId (optional string), knowledgeIds (optional array of strings), hardDelete (optional boolean).
    {
      projectId: z.string().describe('Project ID'),
      knowledgeId: z.string().optional().describe('Single entry ID'),
      knowledgeIds: z.array(z.string()).optional().describe('Multiple entry IDs'),
      hardDelete: z.boolean().optional().describe('Permanently delete instead of archive (default: false)'),
    },
  • The apiDelete helper function used by the handler to send DELETE requests to the AgentBay API.
    async function apiDelete(path: string, body?: unknown) {
      const res = await fetch(`${API_BASE}${path}`, {
        method: 'DELETE',
        headers: getHeaders(),
        ...(body ? { body: JSON.stringify(body) } : {}),
      });
      return res.json();
    }
Behavior3/5

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

Discloses two behaviors (soft delete/archive vs permanent delete) but lacks details on reversibility, permissions required, or side effects. Without annotations, more behavioral context would be beneficial.

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?

Single sentence, 8 words, no redundancy. Efficiently communicates the core action and modes.

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 but lacks context on prerequisites, return values, and parameter usage patterns. Schema covers details, but the description could be more helpful with examples or typical scenarios.

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?

Schema coverage is 100% with clear parameter descriptions. The description adds meaning by connecting the hardDelete parameter to the archive vs permanent delete behavior, highlighting how the parameter controls the action.

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 clearly states the tool's action (archive or permanently delete) and resource (memory entries). It distinguishes from sibling tools like memory_store (create) and memory_recall (read).

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?

No guidance on when to use this tool versus alternatives (e.g., memory_compact for consolidation) or how to decide between archive and permanent delete. No exclusions or context provided.

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/thomasjumper/agentbay-mcp'

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