---
title: "Refine World Endpoint"
method: POST
path: "/api/mcp/refine_world"
tags: ["mcp"]
---

# Refine World Endpoint

`POST /api/mcp/refine_world`

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

Generate a refined world document from the conversation so far.

  apply=false: returns reply.updated_world for preview.
  apply=true: atomically commits.

Returns {editorial_summary, reply.{short_reply, long_reply, updated_world}, applied}.

## Request body

- RefineWorldInput
  - `job_id` string, required: The story job ID.
  - `message` string, required
  - `messages` PlanMessage[]
    - `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
  - `apply` boolean

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