Skip to main content
Glama

memory_merge

Combine two memories into one by merging content and metadata from a source memory into a target memory, then deleting the source.

Instructions

Merge source memory into target, then delete source.

Combines two memories into one, preserving content and metadata.

Args: source_id: Memory ID to merge from (will be deleted) target_id: Memory ID to merge into (will be updated) merge_strategy: How to combine content: - "append": Append source content to target (default) - "prepend": Prepend source content to target - "replace": Replace target content with source

Returns: Updated target memory and deletion confirmation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_idYes
target_idYes
merge_strategyNoappend

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The backend Python server handles MCP-like tool execution for the graph visualization component, including 'create_memory', 'update_memory', and 'delete_memory'.
    def _execute_chat_tool(tool_name: str, arguments: dict) -> str:
        """Execute a chat tool call and return result as JSON string."""
        conn = connect()
        try:
            if tool_name == "create_memory":
                result = add_memory(conn, content=arguments["content"], tags=arguments.get("tags"))
                return json.dumps({"success": True, "action": "created", "memory_id": result["id"], "preview": result["content"][:100]})
    
            elif tool_name == "update_memory":
                mid = arguments["memory_id"]
                result = update_memory(conn, mid, content=arguments.get("content"), tags=arguments.get("tags"))
                if result is None:
                    return json.dumps({"success": False, "error": f"Memory #{mid} not found."})
                return json.dumps({"success": True, "action": "updated", "memory_id": mid, "preview": result["content"][:100]})
    
            elif tool_name == "delete_memory":
                mid = arguments["memory_id"]
                existing = get_memory(conn, mid)
                if not existing:
                    return json.dumps({"success": False, "error": f"Memory #{mid} not found."})
                delete_memory(conn, mid)
                return json.dumps({"success": True, "action": "deleted", "memory_id": mid, "preview": existing["content"][:100]})
    
            return json.dumps({"success": False, "error": f"Unknown tool: {tool_name}"})
        except Exception as e:
            return json.dumps({"success": False, "error": str(e)[:200]})
        finally:
            conn.close()
Behavior4/5

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

With no annotations provided, the description carries full burden and effectively discloses key behaviors: it warns that source will be deleted (destructive side effect), notes that target will be updated, and specifies that content and metadata are preserved. It also outlines the return value. Missing only details on reversibility or atomicity guarantees.

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 optimally structured and front-loaded: the first sentence states the core operation, followed by clarifications, then structured Args and Returns sections. No redundant or wasted language; every sentence adds value beyond the schema.

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?

For a 3-parameter tool with no annotations but with an output schema, the description is nearly complete. It documents the operation, all parameters, merge strategies, and return summary. Minor gap: no mention of error conditions (e.g., non-existent IDs) or permission requirements, but sufficient for agent operation.

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

Parameters5/5

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

The input schema has 0% description coverage (only titles). The description fully compensates by detailing all three parameters: source_id and target_id include their fate (deleted/updated), while merge_strategy explains the three enum values and notes the default ('append'). Excellent semantic coverage where the schema provides none.

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 opens with 'Merge source memory into target, then delete source,' providing a specific verb (merge), resource (memory), and distinguishing this composite operation from siblings like memory_update or memory_delete. It clearly communicates the dual nature of the operation (merge + delete).

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

Usage Guidelines3/5

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

The description implies usage (combining two memories into one), but provides no explicit guidance on when to prefer this over memory_update or memory_delete, nor does it suggest workflows (e.g., using this after memory_find_duplicates). Usage is clear but not contextualized against alternatives.

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/agentic-box/memora'

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