---
title: "Selected Paragraph Chat"
method: POST
path: "/api/mcp/paragraph_chat"
tags: ["mcp"]
---

# Selected Paragraph Chat

`POST /api/mcp/paragraph_chat`

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

Multi-purpose chat about one selected paragraph.

This is the chat-first replacement for the inline note apply flow. It
can explain, critique, retrieve prior context through story-query tools,
discuss revision options, or prepare for a later rewrite plan. It does
not change story text.

## Request body

- SelectedParagraphChatInput
  - `job_id` string, required: The story job ID.
  - `chapter` integer, required
  - `paragraph_index` integer, required: 0-based selected paragraph index.
  - `selected_text` string, nullable: Client-visible selected paragraph text for drift checks/debug context.
  - `message` string, required: User message about the selected paragraph.
  - `messages` PlanMessage[]: Conversation history before this user message.
    - `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.
  - `revision` integer, nullable: Which revision to use as context. None = latest.
  - `use_story_tool` boolean: Allow story-query tools when the user asks for prior context.
  - `auto_save` boolean: Append user+assistant turns to the paragraph-specific chat slot.
  - `request_id` string, nullable: Idempotency key - see ChapterChatInput.request_id.

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