Expand description
Orchestration shared by the CLI and the MCP server.
This wiring is intentionally implemented up front against the frozen signatures of
crate::fetch and crate::parse. It compiles before those modules are filled in
and runs unchanged once they are, so there is no integration step for the seam itself.
Functions§
- discover_
feeds - Discover feeds advertised on a website homepage.
- enforce_
response_ budget - Check
outputagainst a tokenbudget, returning the estimate on success. - estimate_
response_ tokens - Rough token estimate of the serialized
output— i.e. of the payload an MCP client actually receives (pretty JSON, matchingcrate::mcp’s emission). Uses the sameceil(chars / 4)heuristic as per-item content estimates. - exit_
code_ for - Determine the appropriate process exit code from a
FetchOutput. - fetch_
feeds - Fetch and parse many feeds concurrently, returning the full structured output.
- fetch_
feeds_ with - Fetch many feeds concurrently through a caller-provided
HttpClient. The MCP server builds the client once and shares it across tool calls so their per-host pacing coordinates (ADR-0016);fetch_feedsis the thin wrapper that builds a client per call for the CLI. - fetch_
one - Fetch and parse a single feed, returning the
FeedResultplus any non-fatalWarnings the parse surfaced (e.g. a content-extraction fallback). Callers aggregate the warnings intoFetchOutput::warnings. - item_
count - Total number of items across every feed in
output. - show_
item - Fetch a feed (cache-first) and return the single item whose
id, rawguid, or resolvedurlequalskey, if present. - truncation_
marker - Build the
TruncationInfomarker foroutput, orNonewhen nothing was actually cut.