---
title: "Selected Paragraph Apply Plan"
method: POST
path: "/api/mcp/paragraph_apply"
tags: ["mcp"]
---

# Selected Paragraph Apply Plan

`POST /api/mcp/paragraph_apply`

## 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/paragraph_apply`
- Auth: none declared

Apply an approved selected-paragraph chat plan.

Product-facing replacement for the old note apply action. It uses a
dedicated selected-paragraph segment writer: approved plan, cast/world,
beat description, and the target paragraphs only. Use it for scoped
local prose work across one selected paragraph plus nearby paragraphs,
or a small beat/scene range. If the range or intent is unclear, call
get_selected_paragraph_context, continue_selected_paragraph_chat, and
finalize_selected_paragraph_chat first; if the user already supplied a
clear range and final plan, pass force_range directly here.

## Request body

- SelectedParagraphApplyPlanInput
  - `job_id` string, required: The story job ID.
  - `chapter` integer, required: Chapter number containing the selected paragraph.
  - `paragraph_index` integer, required: 0-based selected paragraph index.
  - `final_plan` string, required: Final writer-facing plan approved by the user.
  - `plan` object, nullable: Structured selected-paragraph plan containing range and rationale.
  - `force_range` integer[], nullable: Approved [start, end] paragraph range to apply.
  - `base_revision` integer, nullable: Revision number to revise from. None = latest.
  - `model` string, nullable: Model override.
  - `selected_text` string, nullable: Selected paragraph text captured when the chat plan was approved.
  - `selected_text_hash` string, nullable: Client hash of selected paragraph text captured when the chat plan was approved.
  - `authoring_mode` 'server' | 'client', nullable: Set to 'client' to use the caller's own model. Without revised_paragraphs, returns a no-LLM beat/range rewrite brief; with revised_paragraphs and base_text_hash, commits the client-authored approved range without a server LLM call.
  - `server_llm` boolean, nullable: Set false as an alias for authoring_mode='client'. Do not send model in this mode.
  - `base_text_hash` string, nullable: Full chapter text hash returned by the client selected-paragraph brief; required when committing revised_paragraphs.
  - `revised_paragraphs` string[], nullable: Client-authored replacement paragraphs for the approved range. Selected-paragraph rewrites may replace the approved range with fewer, the same number, or more non-empty paragraphs when that implements the approved plan; an empty array is valid only for an approved delete_paragraph plan with expected output count 0.
  - `dry_run` boolean: Validate revised_paragraphs without committing.
  - `commit` boolean, nullable: Set false as an alias for dry_run=true; only true/default commits.
  - `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 selected-paragraph artifacts.
  - `beat_map_update` BeatMapUpdateInput: Optional as-written map patch for in-place prose mutations.
    - `semantic_impact` 'none' | 'same_beat' | 'changed_beats': none/same_beat = mechanical range shift when wholly inside one entry; changed_beats = require replacement_entries or the map becomes stale.
    - `replacement_entries` object[]: Validated as-written entries covering the resulting edited range when semantic_impact is changed_beats.

## 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)
