myco_intake
Bulk-ingest an entire directory tree of documents into the substrate, creating notes for each file. Supports regex selection, ingest cap, and dry-run preview.
Instructions
Walk a directory, list every adapter-ingestible file via
myco_forage, then call myco_eat on each. The atomic bulk-ingest
composer that replaces the v0.5.x unimplemented
forage --digest-on-read flag.
Single-responsibility composition: forage stays read-only;
eat stays single-note; intake is the only verb that
composes both with a write side-effect.
Use this when: a fresh substrate needs to absorb an existing
directory tree (a paper archive, a code repository, a meeting-log
folder). Use --filter regex to select a subset; --max to
cap ingest count; --dry-run to preview.
Failure semantics: per-file ingest failures produce a
status: failed stub note in notes/raw/ (NOT silent skip;
see L0 P2 + AD1 dim) and are reported in the result payload's
failures list. --strict mode raises on any failure
(exit_code=2).
Side effects: writes 0+ notes to notes/raw/ (one per ingestible file, with frontmatter status=ok|failed). R6 write_surface gated.
Returns: { exit_code, ingested, failed, failures, notes, dry_run }. Use myco_assimilate afterwards to promote the successful raws to integrated.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute or substrate-relative directory path to scan recursively. Forwarded to myco_forage to list adapter-handled files; each gets ingested via myco_eat. Use forward slashes or escaped backslashes on Windows. | |
| filter | No | Optional regex applied to the candidate path string. Only files whose path matches are ingested. Useful for slicing a large tree (e.g. only PDFs: ``\.pdf$``; only one subdir: ``^docs/research/``). | |
| max | No | Hard cap on number of files ingested. Useful for staged ingest of a very large directory: run with --max=100 first, assimilate, then re-run. | |
| dry_run | No | When true, list intended ingest actions without writing. The payload's ``ingested`` and ``notes`` reflect what WOULD happen. | |
| strict | No | When true, any per-file ingest failure raises MycoError (exit_code=2) — strict-mode treats partial failure as full failure. Default false: failures produce stub notes and continue. | |
| project_dir | No | Absolute path of the workspace / project whose Myco substrate this call targets. Overrides auto-discovery. When omitted, Myco resolves via MCP roots/list, then MYCO_PROJECT_DIR, then cwd — the substrate_pulse field in every response echoes which source answered. |