Skip to main content
Glama

Write an episode's script

write_episode_script
Destructive

Writes the scenes of one episode. mode "replace" (default) swaps the whole script (the old scenes stay restorable); "append" adds after the last scene. Each scene: beat (hook → friction → spike → button), action written for close-ups, dialogue lines by speaker name, cast with looks (a character in another shape here, a dragon or wolf form, takes that form look; one who changes shape on screen in the scene starts in look and names the other as transforms_to), location, props, camera, mood and duration_seconds. Refer to characters, looks, locations and props by exact name or id; create them first. Between scenes in one place, every position_hint names a side of the frame and keeps it, and a scene never opens close on the face the scene before ended close on. Every reference is checked before anything is written. Run lint_drama afterwards.

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": {
      "episode_id": "<episode_id>",
      "expected_version": "<expected_version>",
      "scenes": "<scenes>"
    },
    "name": "write_episode_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNo"replace" (default) rewrites the episode's scenes; "append" adds these after the existing ones.replace
scenesYesThe scenes in order, each with its beat, place, characters, action, dialogue and shots.
episode_idYesThe episode id (ep_…), from get_drama_context or get_episode.
expected_versionYesThe version you read; the write fails with VERSION_CONFLICT if it changed since

Output Schema

NameRequiredDescriptionDefault
scenesYes
episode_idYes
total_secondsYes
removed_scenesYes
episode_versionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and non-idempotent, and the description adds real value on top: replace is recoverable ("the old scenes stay restorable") and validation happens before any write ("Every reference is checked before anything is written"). It does not cover failure modes such as version conflicts, which are left to the schema.

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?

Front-loaded with the verb and mode semantics, and nearly every clause encodes a rule rather than filler. It is a dense single block, though, and the long scene-field enumeration reads as a run-on that could be split for faster scanning.

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, multi-scene write with an output schema and full parameter documentation, the description covers the creative contract, reference-resolution prerequisites, continuity constraints, and the lint follow-up. Nothing an agent needs in order to call it correctly 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 the baseline is 3; the description earns above that by explaining the beat arc (hook → friction → spike → button), that action is written for close-ups, and the non-obvious transforms_to rule (start in look, name the other form). The position_hint side-of-frame rule and the no-close-on-close constraint add meaning the schema does not carry.

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: "Writes the scenes of one episode," then immediately distinguishes the two modes (replace vs append) so the agent knows the scope of the write. It is clearly separable from read-side siblings like get_episode and from the follow-up lint_drama it names.

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

Usage Guidelines4/5

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

Gives concrete prerequisites ("Refer to characters, looks, locations and props by exact name or id; create them first") and a required follow-up ("Run lint_drama afterwards"), plus when to pick replace vs append. It stops short of naming when to use this versus a single-scene edit tool, so the exclusion side is only implied.

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.