myco_eat
Ingest text content, local files, or URLs as raw markdown notes with frontmatter and tags, capturing insights immediately at the moment of decision or friction.
Instructions
Ingest raw material into the substrate: one of literal text content, a local file or directory, or an http(s) URL. Writes a markdown file to notes/raw/ with frontmatter (id, source, tags, captured_at). The note enters the raw state of the substrate's metabolism — subsequent myco_assimilate or myco_digest promotes it to integrated.
Use this the MOMENT a decision, friction point, or ingestible artifact appears (R4 of the Hard Contract — "capture insights immediately"). Pass exactly ONE of content/path/url; passing none or more than one is a UsageError. For URLs, install the myco[adapters] extras (PDF, HTML, URL fetchers); the SSRF guard refuses loopback/private/reserved IP ranges (use a text/code file instead when the target is non-public). For path= pointing at a directory, one note is produced per ingestible file found by the adapter registry.
Side effects: creates 1+ files under notes/raw/ (R6-gated by write_surface). Filename pattern: _.md where slug is derived from content/path basename. Atomic O_EXCL create prevents silent overwrites on same-second collisions. merged tags = union(tags, adapter-produced tags), sorted for deterministic output.
Returns (content mode): { exit_code, path, captured_at, tags, source }. Returns (path/url mode): { exit_code, adapter, notes_created, notes: [ { path, captured_at, title, source } ] }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | Literal text body of the note, passed inline as a string. Mutually exclusive with path and url. Use for capturing decisions, frictions, ideas expressed in prose. Empty-string is rejected as UsageError to prevent silent empty notes — pass content=' ' (single space) if you really want an empty body. Max size bounded by normal memory; no hard limit enforced. | |
| path | No | Absolute or relative path to a local file or directory to ingest. Resolved against substrate root when relative. Mutually exclusive with content and url. File adapters auto-selected by extension (text, code, PDF via pypdf, HTML via beautifulsoup if myco[adapters] installed). Directory ingestion walks recursively and produces one note per ingestible file; non-ingestible files are silently skipped. | |
| url | No | http:// or https:// URL to fetch and ingest. Mutually exclusive with content and path. Requires myco[adapters] (httpx). SSRF-guarded: rejects loopback (127.0.0.0/8), link-local, private (10.x/172.16-31.x/192.168.x), multicast, and reserved IANA ranges; scheme restricted to http/https (no file/gopher/ftp/data). Response body capped at 10MB. Content-Type auto-detected: text/html strips tags, application/pdf extracts text, application/json preserves, otherwise raw text. | |
| tags | No | Tags attached to the ingested note's frontmatter, merged with any adapter-provided tags (URL adapter adds 'url' + the domain; file adapters may add extension-based tags). Final tag list is sorted deterministically. Tags are free-form — no validation. Common patterns: decisions, frictions, insights, boilerplate-type labels like 'chat-log' or 'paper-draft'. | |
| source | No | Provenance tag recorded in the note's source frontmatter field. Default 'agent' for agent-authored content. For path/url ingestion, the adapter overrides this with the actual provenance (file path or URL), so this default only affects content= mode. Use to distinguish eat-sourced notes from propagation-sourced or bootstrap-sourced notes in the substrate metabolism. | agent |
| 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. |