Skip to main content
Glama

Merge story elements

merge_entities
Destructive

Merge two story elements that are the same character, place or object: everything that points at the duplicate (fromEntityId) moves onto the element kept (intoEntityId), then the duplicate is deleted as delete_entities would.

What moves: the script lines linked to the duplicate (character cues and their dialogue, scene headings), which also take the kept name, and unlinked cues or headings that name the duplicate; the shots and prompts that cite it (@# tokens and mentions), which then cite the kept element. What goes: the duplicate itself, with its description, moodboard and reference sheet (generated images stay in the Library). The kept element's own name, description and sheet do not change.

Only merge when the user asks or agrees. Call it without confirm first: nothing changes, and it returns a preview (both elements, how many script lines and references move, which shots). Ask the user once, then call again with the same ids and confirm: true. Both must be the same kind; ids come from list_entities.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "fromEntityId": "<fromEntityId>",
      "intoEntityId": "<intoEntityId>",
      "projectId": "<projectId>"
    },
    "name": "merge_entities"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmNoLeave out to get a preview of what would change; nothing is changed. Ask the user to confirm it, then call again with confirm: true once they agree.
projectIdYesScreenWeaver project id (from list_projects).
fromEntityIdYesThe duplicate: its links move to intoEntityId, then it is deleted.
intoEntityIdYesThe story element kept.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description goes well beyond them: it enumerates exactly what is relinked (script lines, cues, headings, @# tokens, shot/prompt citations) and exactly what is destroyed (the duplicate plus its description, moodboard and reference sheet) versus preserved (kept element's name/description/sheet, generated images staying in the Library). It also discloses that the un-confirmed call is a no-op preview, which resolves any tension between destructiveHint and the two-step flow.

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 a one-sentence summary of the whole operation, then organized into 'What moves' / 'What goes' / preservation, then the safety protocol. The labeled structure makes it scannable despite its length, and no sentence is filler.

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 destructive, multi-step merge with no output schema, the description covers inputs, side effects, irreversible loss, the preview return shape ('both elements, how many script lines and references move, which shots'), and the confirmation loop. Nothing an agent needs to call this safely is missing.

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%, so baseline is 3, but the description adds real meaning: it frames fromEntityId as 'the duplicate' whose links migrate, intoEntityId as the survivor, and explains that the same ids must be passed again with confirm. These roles largely mirror the schema's own parameter descriptions, so the incremental value is modest rather than novel.

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?

Opens with a specific verb and resource ('Merge two story elements that are the same character, place or object') and immediately names the direction of the operation (fromEntityId -> intoEntityId, then deletion). It also differentiates itself from the sibling delete_entities by describing the delete as a consequence ('the duplicate is deleted as delete_entities would') rather than as the primary action.

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 states the consent condition ('Only merge when the user asks or agrees'), the two-call protocol (preview without confirm, then confirm: true), a hard constraint ('Both must be the same kind'), and where ids come from ('ids come from list_entities'). An agent has no ambiguity about when to invoke or how to sequence calls.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.