Skip to main content
Glama

delete_passage

Remove specific memories from an agent's archival storage permanently. Use to manage memory by deleting identified passages with agent and memory IDs.

Instructions

Delete a memory from an agent's archival memory store. Use list_passages to find memory IDs. WARNING: This action is permanent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agent_idYesID of the agent whose passage to delete
memory_idYesID of the passage (memory) to delete

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
messageNo
successYes
passage_idNo

Implementation Reference

  • The handler function that implements the logic for the delete_passage tool by calling the API to delete a memory passage.
    export async function handleDeletePassage(server, args) {
        if (!args?.agent_id) {
            server.createErrorResponse('Missing required argument: agent_id');
        }
        if (!args?.memory_id) {
            server.createErrorResponse('Missing required argument: memory_id');
        }
    
        try {
            const headers = server.getApiHeaders();
            const agentId = encodeURIComponent(args.agent_id);
            const memoryId = encodeURIComponent(args.memory_id);
    
            // Use the specific endpoint from the OpenAPI spec
            await server.api.delete(`/agents/${agentId}/archival-memory/${memoryId}`, { headers });
    
            // Successful deletion usually returns 200 or 204 with no body
            return {
                content: [
                    {
                        type: 'text',
                        text: JSON.stringify({
                            memory_id: args.memory_id,
                            agent_id: args.agent_id,
                        }),
                    },
                ],
            };
        } catch (error) {
            // Handle potential 404 if agent or passage not found, or other API errors
            if (error.response && error.response.status === 404) {
                server.createErrorResponse(
                    `Agent or Passage not found: agent_id=${args.agent_id}, memory_id=${args.memory_id}`,
                );
            }
            server.createErrorResponse(error);
        }
    }
  • The tool definition including name, description, and input schema for delete_passage.
    export const deletePassageDefinition = {
        name: 'delete_passage',
        description:
            "Delete a memory from an agent's archival memory store. Use list_passages to find memory IDs. WARNING: This action is permanent.",
        inputSchema: {
            type: 'object',
            properties: {
                agent_id: {
                    type: 'string',
                    description: 'ID of the agent whose passage to delete',
                },
                memory_id: {
                    type: 'string',
                    description: 'ID of the passage (memory) to delete',
                },
            },
            required: ['agent_id', 'memory_id'],
        },
    };
  • Registration of the delete_passage handler in the main tool dispatch switch statement.
    case 'delete_passage':
        return handleDeletePassage(server, request.params.arguments);
  • Inclusion of deletePassageDefinition in the list of all tool definitions for registration.
    deletePassageDefinition,
  • Import of the handler and definition for delete_passage.
    import { handleDeletePassage, deletePassageDefinition } from './passages/delete-passage.js';
Behavior4/5

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

The description adds valuable behavioral context beyond annotations by including 'WARNING: This action is permanent,' which discloses the irreversible nature of the deletion. Since annotations only provide a title ('Delete Archival Memory') and no other hints (e.g., destructiveHint), the description carries the burden of conveying this critical trait, though it could mention response format or error handling.

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 highly concise and well-structured in two sentences: the first states the purpose and usage guideline, and the second provides a critical warning. Every sentence earns its place by adding essential information without redundancy, making it front-loaded and efficient.

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 tool's complexity as a destructive operation with no annotations covering safety, the description is mostly complete by stating the purpose, usage, and permanence warning. Since an output schema exists, it doesn't need to explain return values, but it could improve by mentioning error cases or confirmation steps, leaving a minor gap.

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 does not add semantic details about the parameters beyond what the input schema provides, as schema description coverage is 100% with clear descriptions for agent_id and memory_id. It implies the parameters are needed but doesn't explain their format or relationships, so it meets the baseline of 3 where the schema does the heavy lifting.

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 specific action ('Delete a memory') and resource ('from an agent's archival memory store'), distinguishing it from siblings like delete_agent or delete_memory_block by specifying the target as a passage in archival memory. It uses precise terminology that aligns with sibling tools like list_passages and create_passage.

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?

The description explicitly provides usage guidance by stating 'Use list_passages to find memory IDs,' which indicates a prerequisite step and distinguishes it from alternatives like search_archival_memory. It also includes a warning about permanence, helping the agent understand when to use this tool cautiously versus other read-only 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/oculairmedia/Letta-MCP-server'

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