Skip to main content
Glama

knowledge_merge

Destructive

Consolidate multiple knowledge pages into one canonical page by reparenting and deduplicating citations, then archive superseded pages with tombstones for curator review.

Instructions

Consolidate 2+ knowledge pages into one canonical page. Re-parents all citations from source pages to the target, deduplicating by (claim, source_kind, source_locator, excerpt). Takes MAX(verified_at) across all pages. Losers are superseded: archived with a tombstone and a supersessions pointer to the target. Loser bodies are returned in the result for curator review; set append_loser_bodies=true to concatenate them. Use knowledge_write first if the target body needs updating before merging. Distinct from knowledge_supersede (1:1 pointer, no citation consolidation) — use merge when consolidating data from multiple pages into one.

Input Schema

NameRequiredDescriptionDefault
noteNoOptional note about this merge, stored in supersession tombstones on the losers
target_slugYesSlug of the canonical target page that survives the merge (must already exist)
source_slugsYesSlugs of the pages to merge into the target (all must exist)
hard_delete_losersNoHard-delete losers after archiving them. Losers are archived (supersession pointer written) then DELETEd from the database, cascading their citations.
append_loser_bodiesNoAppend loser page bodies to the target body under section markers (default false). Off by default — curator normally hand-merges body content.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.1
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observedv0.4.1

TDQS

A4.7/5.0
Behavior5/5

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

Despite annotations marking this destructive, the description adds substantial operational detail: citations are re-parented and deduplicated by a specific tuple, verified_at uses MAX across pages, losers are archived with tombstones and supersession pointers, and loser bodies are returned for review. This is well beyond 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?

Front-loaded with the action, then behavior, then alternatives. The density is justified by a destructive multi-step operation, and every sentence contributes either scope, behavior, or routing information.

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?

For a complex destructive merge with no output schema, the description covers citation consolidation, verified_at selection, loser archival, tombstone behavior, returned bodies, and the optional append flag. An agent has enough to call it correctly and anticipate consequences.

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 the schema already documents all five parameters, including hard_delete_losers and append_loser_bodies. The description mentions append_loser_bodies and the result-body behavior, but adds little parameter meaning beyond what the structured schema provides.

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?

States a specific verb and resource — consolidate knowledge pages into one canonical target — and explicitly contrasts with knowledge_supersede. An agent can distinguish this from siblings without opening the schema.

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?

Gives explicit routing: use knowledge_write first if the target body needs updating before merging, and use merge rather than knowledge_supersede when consolidating multiple pages. It names both the prerequisite and the alternative tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.