---
title: "Plan Chapter"
method: POST
path: "/api/mcp/plan_chapter"
tags: ["mcp"]
---

# Plan Chapter

`POST /api/mcp/plan_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/plan_chapter`
- Auth: none declared

Create or register a versioned initial beat plan for an unwritten chapter.

## Request body

- PlanChapterInput
  - `job_id` string, required: The story job ID.
  - `chapter` integer, required: Unwritten chapter number to plan.
  - `message` string: Planning instruction for the initial chapter plan.
  - `messages` PlanMessage[]: Complete chapter planning chat transcript to use when generating the beat plan.
    - `role` string, required
    - `content` string
    - `plan` object, nullable
    - `cover` object, nullable
    - `writer_thinking` string, nullable
    - `writer_thinking_data` object, nullable
    - `metadata` object, nullable
    - `type` string, nullable
    - `applied_at` string, nullable
    - `applied_revision` integer, nullable
    - `applied_status` string, nullable
  - `model` string, nullable: Model override for server-side planning.
  - `target_words` integer, nullable: Target word count for the future chapter.
  - `authoring_mode` 'server' | 'client', nullable: Set to 'client' to return a no-LLM planning brief or commit client_plan without server LLM usage.
  - `server_llm` boolean, nullable: Set false as an alias for authoring_mode='client'. Do not send model in this mode.
  - `client_plan` ClientInitialChapterPlanInput
    - `short_plan` string, required: Concise user-facing first-draft chapter plan summary.
    - `long_plan` string, required: Detailed writer-facing first-draft chapter plan.
    - `beats` ClientInitialChapterBeatInput[], required: Ordered beats for the first-draft chapter. Beat summaries should read as the chapter's main event outline; details add local beat-specific material only.
      - `num` integer, nullable: 1-based beat number in first-draft chapter order.
      - `index` integer, nullable: Compatibility alias for num.
      - `summary` string, required: Main event of this beat. Reading all summaries in order should cover the chapter's main things that happen. Use a specific event sentence, not a vague location/title.
      - `details` string, required: Beat-level elaboration: local context, concrete inclusions, emphasis, action/dialogue texture, or constraints specific to this beat. This is not full prose and not generic style coaching.
      - `type` 'scene_break' | 'action' | 'revelation' | 'decision' | 'dialogue' | 'reflection' | 'explicit', required: Dominant movement category for this beat's main event.
      - `title` string, nullable: Compatibility alias for summary.
      - `description` string, nullable: Compatibility alias for details.
      - `category` 'scene_break' | 'action' | 'revelation' | 'decision' | 'dialogue' | 'reflection' | 'explicit', nullable: Compatibility alias for type.
      - `change` string, nullable: Optional compatibility field for the beat's change.
      - `story_function` string, nullable: Optional note on why this beat matters in the chapter sequence.
      - `budget_action` 'bridge' | 'compress' | 'expand' | 'preserve', nullable: Optional qualitative budget action. Do not include per-beat target_words.
      - `budget_note` string, nullable: Optional qualitative budget guidance. Do not include word-count budgets.
      - `characters` string[]: Optional character names present in this beat.
  - `select` boolean: When storing a plan, make it the selected initial plan consumed by write_chapter.
  - `notes` string[]: Optional comments/notes to attach to this initial chapter plan artifact.
  - `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_plan artifacts.
  - `auto_save` boolean: Reserved for future chapter-plan chat persistence. Currently ignored.
  - `request_id` string, nullable: Optional idempotency key for clients.

## Response `200`

Successful Response

- GenericToolResponse: Fallback for tools whose payload is still being tightened.
  - `story_url` string, nullable
  - `article_url` string, nullable
  - `job_id` string, nullable
  - `status` string, nullable
  - `is_terminal` boolean, 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)
