Skip to main content
Glama

Graph Merge

graph_merge
Destructive

Consolidate duplicate entities by merging one into another, transferring edges and adopting missing properties. Preview with dry_run first as merging is destructive.

Instructions

Consolidate two entities into one — moves source's edges onto target, adopts source properties for keys target doesn't have, then deletes source. Inverse of graph_unmerge. Use after graph_merge_suggestions surfaces a duplicate pair, or whenever you've confirmed two nodes refer to the same thing. Same-tenant only; refuses to merge an entity with itself. Edges directly between source and target are dropped (would become self-loops). When source and target both have the same edge to a third node, the edge is consolidated and the higher weight wins. Target's embedding is cleared so the next graph_reembed will re-derive it from the merged state. Logged to logs/merge-audit.jsonl with reason. DESTRUCTIVE — always preview with dry_run=true first; recovery requires a graph_export backup or graph_unmerge with the original edge layout.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_idYesEntity ID to merge from (will be deleted)
target_idYesEntity ID to merge into (will absorb source)
reasonYesWhy merging (logged in audit)
dry_runNoPreview only, don't apply changes (default: false)
Behavior5/5

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

Despite annotations providing destructiveHint=true, description adds crucial details: edges between source and target dropped, edge consolidation with higher weight wins, target's embedding cleared, audit logging. No contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is well-structured, front-loaded with key action, then details. It is slightly long but each sentence adds value.

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

Completeness5/5

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

Complex tool with many behaviors; no output schema but description mentions return behavior (dry_run preview, audit logging). Covers edge cases, destructive nature, recovery. Very complete.

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 coverage is 100%, so baseline 3. Description doesn't add much beyond schema for parameters, but it does mention dry_run for preview and reason for audit. However, the description is more about behavior than parameter-level specifics.

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 states the tool consolidates two entities, moves edges, deletes source, and adopts properties. It clearly distinguishes from siblings like graph_unmerge (inverse) and graph_merge_suggestions (precursor).

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?

Explicitly says when to use (after graph_merge_suggestions or confirmed duplicates), and what not to do (same-tenant only, refuses self-merge). Mentions preview with dry_run, and alternative graph_unmerge for recovery.

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/stevepridemore/graph-memory'

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