scan_manuscript_markers
Identify all TODO, FIXME, DRAFT, TBD, and XXX markers in manuscript markdown to flag incomplete sections and pending tasks.
Instructions
Find TODO/FIXME/DRAFT/TBD/XXX markers in manuscript markdown.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/storywright_mcp/app.py:326-332 (registration)FastMCP tool registration for scan_manuscript_markers. The @mcp.tool() decorator registers it. The handler delegates to workflow.scan_manuscript_markers().
@mcp.tool() async def scan_manuscript_markers() -> str: """Find TODO/FIXME/DRAFT/TBD/XXX markers in manuscript markdown.""" try: return workflow.scan_manuscript_markers() except ValueError as e: return str(e) - src/storywright_mcp/workflow.py:656-676 (handler)Core implementation: scans all *.md files in the manuscript/ directory for TODO/FIXME/DRAFT/TBD/XXX markers using MARKER_RE regex, counts occurrences, and returns a summary with up to 40 sample lines.
def scan_manuscript_markers() -> str: proj, _ = require_project() root = proj.base_path / "manuscript" if not root.exists(): return "No manuscript/ directory." counts: dict[str, int] = {} samples: list[str] = [] for path in sorted(root.glob("*.md")): text = path.read_text(encoding="utf-8", errors="replace") for m in MARKER_RE.finditer(text): k = m.group(1).upper() counts[k] = counts.get(k, 0) + 1 for i, line in enumerate(text.splitlines(), 1): if MARKER_RE.search(line): samples.append(f"{path.name}:{i}: {line.strip()[:160]}") if not counts: return "No TODO/FIXME/DRAFT/TBD/XXX markers found." summary = ", ".join(f"{k}={v}" for k, v in sorted(counts.items())) tail = "\n".join(samples[:40]) extra = "\n… truncated …" if len(samples) > 40 else "" return f"# Markers\n{summary}\n\n{tail}{extra}" - MARKER_RE regex constant used by scan_manuscript_markers to match TODO, FIXME, DRAFT, TBD, or XXX (case-insensitive).
MARKER_RE = re.compile(r"\b(TODO|FIXME|DRAFT|TBD|XXX)\b", re.I)