Skip to content

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_export currently returns DOT/SVG content in-memory — never writes to disk
  • docs_collect copies flow docs + notebook outputs to docs/pipelines/<pipe>/<flow>/ but doesn't generate DAG SVGs
  • An agent currently has to chain: dag_export → write file → docs_collectdocs_navmkdocs_nav_patch
  • pipeio_nb_pipeline already 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_path is set (or defaulted), write SVG to disk and return the path
  • Default: docs/pipelines/<pipe>/<flow>/dag.svg
  • When output_format="dot" and no output_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 path
  • pipeio flow dag <flow> --format dot → stdout (for piping to dot)
  • Add to pf.sh as pf <flow> dag

4. MCP: pipeio_docs_build convenience tool

  • Single tool that chains: docs_collect (including DAG) → docs_navmkdocs_nav_patch
  • Optional build_site: bool to also run site_build at the end
  • Returns summary of collected files, nav changes, build status

Acceptance Criteria

  • [ ] pipeio flow dag ieeg writes docs/pipelines/preprocess/ieeg/dag.svg
  • [ ] pipeio docs collect includes 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)