get_chapter_status
Retrieve the current status and details of a specific chapter in the book writing pipeline by providing its chapter number.
Instructions
Inspect one chapter.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chapter_num | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/storywright_mcp/workflow.py:497-511 (handler)Core implementation: fetches chapter data (title, status, editor verdict, third_pass_completed) and checks for draft/approved manuscript files.
def get_chapter_status(chapter_num: int) -> str: proj, _ = require_project() chapter = proj.get_chapter(chapter_num) if not chapter: return "Chapter not found." draft = proj.base_path / "manuscript" / f"chapter-{chapter_num:02d}-draft.md" appr = proj.base_path / "manuscript" / f"chapter-{chapter_num:02d}-approved.md" return ( f"## Chapter {chapter_num}: {chapter.title}\n" f"- Status: {chapter.status.value}\n" f"- Verdict: {chapter.editor_verdict or '—'}\n" f"- Third passes done: {chapter.third_pass_completed}\n" f"- Draft exists: {draft.exists()}\n" f"- Approved exists: {appr.exists()}\n" ) - src/storywright_mcp/app.py:226-232 (registration)Registers `get_chapter_status` as an MCP tool via the @mcp.tool() decorator, wrapping the workflow function with error handling.
@mcp.tool() async def get_chapter_status(chapter_num: int) -> str: """Inspect one chapter.""" try: return workflow.get_chapter_status(chapter_num) except ValueError as e: return str(e)