Purpose
codearia-sieve is used to parse web pages into the precise format required by decision models: dates as dates, numbers with units as facts, and text split into chunks that fit the model window, with each chunk pointing back to its source on the page. It does the mining work before the model and returns the "state" of the page, not prose.
Main capabilities
- Dates into dates: for example, "Published September 15, 2026" → "2026-09-15". Prefer reading from JSON-LD, meta tags, and <time>; read from bylines only when the markup is silent, and never guess.
- Numbers into facts: for example, "$42 per billion tokens" → { value: 42, unit: "USD_per_billion" }. Supports nine languages; decimal commas follow the page language. Numbers without units are not treated as facts, and years are never treated as facts.
- Text into suitable chunks: each chunk knows its token and character size, which chunks it was built from, and the #anchor on the page for verifying decisions.
- Remove irrelevant content: menus, footers, banners, tag lines, "Read more", etc. are removed; use trace: true to get a list of what was removed and why.
- Determinism: eight steps of ordinary code, and no model runs unless you connect one. The same HTML produces byte-for-byte identical JSON.
How to use
Use from an agent
You state the requirements in plain language. The agent finds the pages, calls sieve_page for each page, hands the state together with typed questions to the decision model, and writes the result. Sieve prepares, judge judges, agent writes.
It is listed in the official MCP Registry as io.github.AntonG87/codearia-sieve; clients that read the registry can install it by name.
- sieve_page — parameters are url or html. Returns typed structuredContent with an output schema: source, state, usage, warnings. In the default summary mode, chunks carry size, anchors, and headings but no text—the agent sees the outline of what exists without paying. If all in is neededtolerance uses mode: "full" and mode: "markdown".
- sieve_chunk — parameters are url, id. Returns the text of a chunk from the previous result for that URL, without re-fetching. First get the overview, then fetch on demand.
Paired with jev-mcp: chunk sizes fit its fields, so state can go directly into typed questions.
Using as a library
parseDate, findDates, and vendor restrictions (JEV, JEV_MCP, DEFAULT_BUDGET) are also exported.
When to use
- Building agents and having seen the token bill. Every fetched page costs tens of thousands of tokens before the agent reads a single word. Median page in the sample: 53,718 input tokens, 1,106 output tokens.
- Running low-cost decision models. Classifiers, rankers, System One models like Jev that judge rather than write. They are nearly free and very fast, but have hard boundaries: cannot count, read dates as text, and lose accuracy when irrelevant material fills the context. Every "page to markdown" tool prepares input for the reader, while this tool prepares input for the judge.
- Needing verifiable answers. A verdict from scraped text cannot be proven unless every part points back to its source. Here every fact indicates its chunk, and every chunk carries its anchor.
Limitations
- Home pages, listing pages, and product pages have no article to find. You get a title and a thin-content warning instead of a false victory.
- Articles rendered by JavaScript return empty-without-js when the container is empty. Sites that publish a teaser and stream the rest cannot be distinguished without a browser; what you get is the teaser.
- Text-dense pages save less. A whole novel saves 22%, an RFC saves 84%: with no wrapper to remove, the text is kept intact. This is the tool working correctly.
- Pricing grids are not tables. A fact knows which chunk it came from, not which plan column it sits under; Sieve does not guess pairings. Send that chunk — roughly a thousand tokens after the pricing page is cleaned — and let the judge read it.
- Token counts use o200k as an approximation. Pages over one megabyte get sampled counts and usage.rawTokensEstimated: true.
- Expected results never throw exceptions, but return as warnings, each with a name.
Other information
Design notes (vision and architecture) are in docs/. License is MIT © 2026 Anton Evelson · Codearia Academy.