screenplay_rewrite_run
Generate scoped screenplay rewrite proposals and apply them later by proposal_id. This is a freeform MCP rewrite tool, separate from the website's Sync Screenplay workflow.
When to use
Use when the caller wants a direction-driven rewrite over a scene, range, character, or whole screenplay.
For a selected screenplay passage, use `workflow=range_rewrite` with `scope.block_range` anchored by `scene_id`, `start_block_id`, and optional `end_block_id` from `screenplay_read`.
Use `readiness` to confirm the screenplay document exists before `start`; workflow-specific scope validation happens at `start`.
Use apply to commit a previously minted rewrite proposal.
When not to use
Do not use for the website's story-to-screenplay reconciliation flow; that is Sync Screenplay in the app and `project_updates` / continuity flows in MCP-adjacent guidance.
Do not use for single selection edits that fit `screenplay_edit_*`.
Do not use when the caller provides exact replacement screenplay text for one scene; use `screenplay_snapshot_apply` with `replace_scene_from_text`.
Do not use when the agent already has exact block-level replacement text after inspection; use `screenplay_snapshot_apply` for that deterministic write.
Do not use for first-pass story outline generation.
Examples
“Rewrite one scene to make the conflict sharper.”
“Rewrite the selected cabin passage with `workflow=range_rewrite` and `scope.block_range` from the first to last affected block IDs.”
“Rewrite one character's dialogue across the draft.”
“Apply a saved rewrite proposal.”
Anti-examples
- Read one screenplay scene.
- Replace this scene exactly with the Fountain text I pasted.
- Generate a new outline from a raw idea.
Backend capabilities
Linked resources
Tool calls may return resource_links pointing at these resource families.
Input schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
"workflow",
"phase",
"project_id"
],
"properties": {
"workflow": {
"type": "string",
"enum": [
"scene_rewrite",
"range_rewrite",
"character_rewrite",
"whole_rewrite"
]
},
"phase": {
"type": "string",
"enum": [
"readiness",
"start",
"apply"
]
},
"project_id": {
"type": "integer"
},
"direction": {
"type": "string",
"maxLength": 8000
},
"scope": {
"type": "object",
"properties": {
"scene_id": {
"type": "string"
},
"scene_codes": {
"type": "array",
"items": {
"type": "string"
}
},
"character_name": {
"type": "string"
},
"sequence_code": {
"type": "string"
},
"act_code": {
"type": "string"
},
"block_range": {
"type": "object",
"description": "Inclusive screenplay passage anchor for workflow=range_rewrite. Use block IDs returned by screenplay_read. Recommended shape: {\"scene_id\":\"...\",\"start_block_id\":\"...\",\"end_block_id\":\"...\"}; omit end_block_id for a single-block range.",
"properties": {
"scene_id": {
"type": "string",
"description": "Screenplay scene or episode ID containing the selected range."
},
"start_block_id": {
"type": "string",
"description": "Inclusive first screenplay block ID from screenplay_read."
},
"end_block_id": {
"type": "string",
"description": "Inclusive last screenplay block ID from screenplay_read. Omit when rewriting one block."
}
},
"additionalProperties": true
}
},
"additionalProperties": false
},
"proposal_id": {
"type": "string"
}
},
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"phase": {
"const": "start"
}
}
},
"then": {
"required": [
"direction"
]
}
},
{
"if": {
"properties": {
"phase": {
"const": "apply"
}
}
},
"then": {
"required": [
"proposal_id"
]
}
}
]
}Output schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
"phase",
"workflow"
],
"properties": {
"phase": {
"type": "string"
},
"workflow": {
"type": "string"
},
"proposal_id": {
"type": "string"
},
"summary": {
"type": "array",
"items": {
"type": "object"
}
},
"updates": {
"type": "array",
"items": {
"type": "object"
}
},
"creates": {
"type": "array",
"items": {
"type": "object"
}
},
"notes_patch": {
"type": "object"
},
"screenplay_ops": {
"type": "object"
},
"readiness": {
"type": "object"
},
"applied_summary": {
"type": "object"
},
"snapshot_rev": {
"type": "integer"
},
"credits_charged": {
"type": "number"
},
"credits_skipped_reason": {
"type": "string"
},
"no_op_reason": {
"type": "string"
},
"resource_links": {
"type": "array",
"items": {
"type": "object"
}
}
},
"additionalProperties": true
}