Append turn
append_turnSaves one explicit dialogue turn—speaker, exact text, and canon status—to a story with revision checks and idempotency to prevent duplicate appends.
Instructions
Save one explicit turn: the speaker, the exact text, and a status. This writes saved fiction and is the only way dialogue enters the store. idempotency_key is required, so retrying the same call cannot duplicate the turn (reusing a key with different arguments is refused). expected_revision must match the current story revision. status=completed means settled canon; draft, cancelled and failed are stored but are not canon. The tool confirms the stored turn id and new revision.
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": {
"story_id": "<story_id>",
"speaker": "<speaker>",
"text": "<text>",
"idempotency_key": "<idempotency_key>",
"expected_revision": "<expected_revision>"
},
"name": "append_turn"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| status | No | completed | |
| speaker | Yes | ||
| story_id | Yes | ||
| branch_id | No | ||
| parent_turn_id | No | ||
| idempotency_key | Yes | ||
| expected_revision | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| turn | Yes | ||
| revision | Yes | New story revision after this write. | |
| story_id | Yes | ||
| branch_id | Yes | ||
| idempotent_replay | No | True when this result was replayed from an earlier identical call. |