## Prompt Implement P0 manuscript MCP tools: `manuscript_section_context` and e
Prompt¶
Implement P0 manuscript MCP tools: manuscript_section_context and enhanced manuscript_overview. Then create and schedule P2/P3 follow-up tasks.
Phase 1: Update spec¶
Before any implementation, update the design spec at docs/specs/notio/manuscript.md:
- Add a new section "## Agentic Tools" documenting the full tool ontology (P0–P3)
- For each tool, document: purpose, parameters, return schema, which subsystems it queries
- Document the manuscript ontology diagram (entities, relationships, interactions)
- Document the lifecycle: scaffold → draft → populate → validate → render → review → submit
The spec is the source of truth. Implementation follows from it.
Phase 2: Implement P0 tools¶
manuscript_section_context(name, section)¶
One-call context gathering for drafting a section. Returns:
current_content: current section text (via note_read)rag_hits: top RAG results for the section title/key (via rag_query)figures: descriptions of figures mapped to this section (from manuscript.yml mappings + figio FigureSpec if available)citations_used: list of[@citekey]already in this section's textrelated_notes: relevant notes/ideas (via note_search with section title as query)word_count: current word count of the section
Implementation location: src/projio/mcp/manuscripto.py — add the function. It should:
1. Load ManuscriptSpec, find the section
2. Read section file content
3. Call rag_query internally (import from projio.mcp.rag or call the library directly)
4. Scan for [@citekey] patterns in the text
5. Look up figure mappings that reference this section
6. Call note_search for related notes
7. Return all as a structured dict
Also register in src/projio/mcp/server.py.
Enhanced manuscript_overview(name) (replace current manuscript_status)¶
Returns richer status:
- Per-section: key, title, word_count, citation_count, figure_ref_count, status (from frontmatter)
- Totals: total_words, total_citations, total_figures
missing_citations: citekeys referenced in text but not in .bib filemissing_figures: figure IDs in mappings without built outputsstale_figures: figure specs newer than built outputs (compare mtime)bibliography: path, entry_count, papers_with_fulltext (count of docling extractions)
Implementation: enhance the existing manuscript_status function in manuscripto.py, or add manuscript_overview as a new tool alongside it.
Phase 3: Implement P1 tools¶
manuscript_cite_check(name)¶
Citation-focused validation:
- Scan all sections for [@citekey] patterns
- Cross-check each against the .bib file (parse with regex — look for @article{key, etc.)
- For each found citekey, check if biblio has a docling extraction (full text available for RAG)
- Return: {found: [{citekey, sections, has_fulltext}], missing: [{citekey, sections}], suggestions: ["run biblio_docling on X"]}
manuscript_figure_build_all(name)¶
Batch figure build:
- Load ManuscriptSpec, iterate figure mappings
- For each mapping with a spec path, check if figio is available
- Call figio build on each (import from figio.build or call figio_build MCP tool)
- Return per-figure status: {figure_id, status: "built"|"failed"|"skipped", path?, error?}
Phase 4: Create and schedule P2/P3 tasks¶
After implementing P0 and P1, create task notes (using worklog_note) for P2 and P3:
P2 task — manuscript_diff + manuscript_cite_suggest:
- manuscript_diff(name): assemble current sections, compare against last _build/assembled.md, return diff summary (sections changed, word count delta, new/removed citations)
- manuscript_cite_suggest(name, section, claim?): search RAG biblio corpus for papers relevant to a section or claim, return ranked citekeys with snippets
- Update spec FIRST, then implement
P3 task — manuscript_journal_check:
- manuscript_journal_check(name, journal?): check word count limits, figure count limits, required sections, CSL match against journal target profiles
- Could reuse figio's TargetProfile concept
- Update spec FIRST, then implement
Schedule the P2 task with after dependency on this task's queue_id. Schedule P3 with after dependency on P2.
Use: worklog_note(project_id="projio", kind="task", text="## Prompt\n\n...") then schedule_queue(after="<this_queue_id>", ...).
The queue_id of THIS task (the one you're executing right now) should be available from the task execution context or you can use list_queue(query="P0 manuscript", status="running") to find it.
Prerequisites¶
- Read the existing spec:
docs/specs/notio/manuscript.md - Read the current manuscripto MCP:
src/projio/mcp/manuscripto.py - Read the current server registration:
src/projio/mcp/server.py - Read
packages/notio/src/notio/manuscript/modules for available library functions - Read
src/projio/mcp/rag.pyto understand how to call RAG internally
Notes¶
- Spec updates go in
docs/specs/notio/manuscript.md - All new tools go in
src/projio/mcp/manuscripto.py(projio wrapper) — NOT in notio directly, since these tools orchestrate across subsystems (RAG, biblio, figio, notio) - Register each new tool in
src/projio/mcp/server.py - Update CLAUDE.md MCP tool lists after adding tools
- The cascading schedule pattern: this task creates P2/P3 tasks and schedules them with
afterdependencies
Related Notes¶
- task-arash-20260331-175313-566067.md — manuscripto design spec — architecture and API surface; current task updates and implements from this spec
- task-arash-20260331-175617-644481.md — design spec for manuscript as notio subpackage — current task adds Agentic Tools section to this spec
- task-arash-20260331-175703-656609.md — implement manuscript subpackage in notio — current task extends with P0 agentic MCP tools
- task-arash-20260331-175739-980549.md — register manuscript MCP tools in notio and projio — directly related to adding manuscript_section_context and manuscript_overview
- task-arash-20260331-175508-399347.md — register manuscripto in projio MCP tools — current task adds new tools to the same registration layer