Write an episode's script
write_episode_scriptWrites 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
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | "replace" (default) rewrites the episode's scenes; "append" adds these after the existing ones. | replace |
| scenes | Yes | The scenes in order, each with its beat, place, characters, action, dialogue and shots. | |
| episode_id | Yes | The episode id (ep_…), from get_drama_context or get_episode. | |
| expected_version | Yes | The version you read; the write fails with VERSION_CONFLICT if it changed since |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scenes | Yes | ||
| episode_id | Yes | ||
| total_seconds | Yes | ||
| removed_scenes | Yes | ||
| episode_version | Yes |