Skip to content

## Prompt Implement P2 manuscript agentic tools: `manuscript_diff` and `manuscr

Prompt

Implement P2 manuscript agentic tools: manuscript_diff and manuscript_cite_suggest.

Prerequisites

  • Read the updated spec at docs/specs/notio/manuscript.md — the "Agentic Tools" section documents the P2 tool contracts.
  • Read src/projio/mcp/manuscripto.py for existing P0/P1 tool patterns.

Phase 1: Update spec

Before implementation, update the P2 section in docs/specs/notio/manuscript.md with detailed parameter/return schemas (matching the P0/P1 format already there).

Phase 2: Implement

manuscript_diff(name)

  • Load ManuscriptSpec, call assemble() to get current assembled text
  • Read _build/assembled.md (last build output) if it exists
  • Compare: sections changed, word count delta, new/removed citations
  • Use difflib or simple line comparison — no external deps
  • Return: {sections_changed: [...], word_count_before, word_count_after, word_count_delta, citations_added: [...], citations_removed: [...]}

manuscript_cite_suggest(name, section, claim?)

  • Load section content (or use claim text if provided)
  • Call rag_query against biblio corpus with section/claim text
  • Filter results to bibliography-related hits
  • For each hit, extract citekey if available
  • Return: {suggestions: [{citekey, relevance_score, snippet, source}]}

Phase 3: Register and document

  • Register both tools in src/projio/mcp/server.py
  • Update CLAUDE.md MCP tool list for manuscripto.py

Notes

  • All tools go in src/projio/mcp/manuscripto.py — NOT in notio directly
  • Follow the existing _find_manuscript_dir + _manuscript_available guard pattern
  • Degrade gracefully when RAG/biblio unavailable