---
title: "Write Chapter"
method: POST
path: "/api/mcp/write_chapter"
tags: ["mcp"]
---

# Write Chapter

`POST /api/mcp/write_chapter`

## Request

- Base URL: `https://writer.swapp1990.org` (the document declares no server; this is the origin it was published from)
- URL: `https://writer.swapp1990.org/api/mcp/write_chapter`
- Auth: none declared

Write one unwritten chapter by number, possibly out of order.

Differs from resume_writing in that the caller picks which chapter
instead of always starting from the lowest unwritten one. Useful
when the user wants to attempt a later chapter after an earlier one
failed (e.g. an LLM safety rejection) and they don't want to
re-trigger the failing chapter first.

Refused (409) when the chapter has no outline, is already written,
or another writing/revision job is in flight.

## Request body

- WriteChapterInput
  - `job_id` string, required: The story job ID.
  - `authoring_mode` 'server' | 'client', nullable: Set to 'client' to have write_chapter return a no-LLM chapter brief or commit client-authored text.
  - `server_llm` boolean, nullable: Set false as an alias for authoring_mode='client'. Do not send model in this mode.
  - `title` string, nullable: Optional title when committing client-authored chapter text.
  - `text` string, nullable: Client-authored chapter prose to commit through write_chapter in client mode.
  - `summary` string, nullable: Short client-authored chapter summary for future briefs.
  - `handoff` string, nullable: End-of-chapter continuity handoff for future briefs.
  - `beats` object[]: Optional beat plan that drove this client-authored chapter.
  - `carry_forward_facts` string[]: Continuity facts the client wants carried forward.
  - `open_loops_started` string[]: Open loops introduced by this chapter.
  - `open_loops_resolved` string[]: Open loops resolved by this chapter.
  - `client_name` string: Client identity for no-LLM provenance.
  - `client_model` string, nullable: Client-side model name for no-LLM provenance. Never used for server API calls.
  - `artifact_version` string: Version label for submitted client chapter artifacts.
  - `plan_id` string, nullable: Selected initial chapter plan id to consume when writing this unwritten chapter.
  - `dry_run` boolean: Preview the missing-chapter write inputs without starting a writer job or committing prose.
  - `chapter` integer, required: Chapter number to write. Must exist in the outline and not already have written prose. Skips chapters earlier in the outline that are still unwritten — the writer's continuity ledger is built only from chapters that already have text.

## Response `200`

Successful Response

- StoryMutationResponse
  - `job_id` string, nullable
  - `status` string, nullable
  - `story_url` string, nullable
  - `chapter` integer, nullable
  - `kind` string, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/swapp1990/apis/writeforyou-mcp-api.md) · [All operations](https://skmtc.dev/swapp1990/apis/writeforyou-mcp-api/llms.txt) · [OpenAPI document](https://skmtc.dev/swapp1990/apis/writeforyou-mcp-api/revisions/ce5e2a89ab4d?raw)
