myco_forage
Enumerate files in a directory that can be ingested by Myco adapters, displaying file details and matching adapter. Preflight check before bulk import to avoid surprises.
Instructions
Enumerate every file under the given path that a Myco adapter can ingest — the "what could myco_eat do here?" preflight. Each returned item includes file path, size, suffix, and the matching adapter's name (text-file, pdf, html, tabular, code-repo, url-fetcher).
Use this before a bulk myco_eat --path= invocation to see what will actually get ingested (and what will be silently skipped because no adapter handles it). Also useful for "what's in this directory" inventory without reading every file's content. Do NOT use this on the substrate root itself recursively — for that, prefer myco_sense or direct filesystem access; forage is for potential-intake surveys.
Side effects: none. Pure read. Adapter registry is walked in import order; more-specific adapters (PDF, HTML, URL) win over the generic text-file adapter.
Returns: { exit_code, target, count, skipped, items: [ { path,
size, suffix, adapter } ] }. skipped counts files that matched
no adapter (binary blobs, non-text non-code non-document files).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Absolute or relative path to scan. When null/omitted, defaults to the substrate root. Directory is walked recursively; files are checked one-by-one against the adapter registry. For a single-file preflight, pass the file path directly (items list will have 0 or 1 entries). | |
| 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. |