DAG SVG export to docs + pipeio_docs_build convenience tool¶
Goal¶
Write DAG SVGs to disk and build a single convenience MCP tool that chains the full flow docs pipeline.
Context¶
mcp_dag_exportcurrently returns DOT/SVG content in-memory — never writes to diskdocs_collectcopies flow docs + notebook outputs todocs/pipelines/<pipe>/<flow>/but doesn't generate DAG SVGs- An agent currently has to chain:
dag_export→ write file →docs_collect→docs_nav→mkdocs_nav_patch pipeio_nb_pipelinealready exists as a single-notebook convenience chain; this is the flow-level equivalent
Tasks¶
1. mcp_dag_export: add output_path param with default¶
- When
output_pathis set (or defaulted), write SVG to disk and return the path - Default:
docs/pipelines/<pipe>/<flow>/dag.svg - When
output_format="dot"and nooutput_path, return content only (for piping)
2. docs_collect: auto-generate DAG SVG per flow¶
- During collection, call
dag_export(graph_type="rulegraph", output_format="svg")for each flow - Write to
docs/pipelines/<pipe>/<flow>/dag.svg - Skip gracefully if snakemake or graphviz not available
3. CLI: pipeio flow dag¶
pipeio flow dag <flow>→ generates SVG to docs pathpipeio flow dag <flow> --format dot→ stdout (for piping to dot)- Add to
pf.shaspf <flow> dag
4. MCP: pipeio_docs_build convenience tool¶
- Single tool that chains:
docs_collect(including DAG) →docs_nav→mkdocs_nav_patch - Optional
build_site: boolto also runsite_buildat the end - Returns summary of collected files, nav changes, build status
Acceptance Criteria¶
- [ ]
pipeio flow dag ieegwritesdocs/pipelines/preprocess/ieeg/dag.svg - [ ]
pipeio docs collectincludes DAG SVG per flow - [ ]
pipeio_docs_build()MCP tool chains collect → nav → nav_patch - [ ] Graceful degradation when snakemake/graphviz unavailable
- [ ] Docs updated (mcp-tools spec, cli reference, how-to)
Result¶
(Filled in after execution)