@pipeworx/west-virginia-code
Connect: https://pipeworx.io/mcp — every tool in the catalog, including @pipeworx/west-virginia-code’s. Install: one-click buttons
Connect to just the @pipeworx/west-virginia-code pack
https://gateway.pipeworx.io/west-virginia-code/mcp — only @pipeworx/west-virginia-code’s own tools, nothing else in the catalog.
No MCP client? Skip the connection: POST https://gateway.pipeworx.io/v1/tools/search_packs {"query":"..."} to find a tool below, GET /v1/tools/<name> for its schema, POST the same URL with arguments for the data — see For AI agents.
Tools: 1
Keyless. 61-2-1 is first degree murder.
See docs/state-law-probe.md — every state pack proves a MISS is
distinguishable from a HIT before shipping, because many state sites answer
HTTP 200 for statutes that do not exist.
Stored copy and data_as_of (fleet #3546)
The Legislature’s code site answers US data centres but fails from China and Singapore. A cache cannot help a first touch, so the West Virginia Code is stored, one JSON
object per chapter, in the shared statute store (R2, statutes/wv/) that the Illinois,
Indiana, North Carolina, Wisconsin and Wyoming packs also use. The gateway hands the
pack its R2 binding and the pack reads only the object a call names (a very large
chapter is a small head plus parts, and a call reads the head and one part). A section
found there is answered with no upstream request; the response says
served_from: "stored-copy" and carries data_as_of (when that chapter was last read
from the source). A section the copy cannot answer (chapter missing, object unreadable,
or listed with no stored text) falls back to the live read. Absence is never remembered:
a chapter published later is served as soon as it exists.
Nothing is loaded at module scope: the data never enters the gateway bundle.
Refresh
node mcps/west-virginia-code/scripts/bake-chapters.mjs # all chapters -> mcps/west-virginia-code/.bake/
node mcps/west-virginia-code/scripts/bake-chapters.mjs --only X # one chapter
node mcps/west-virginia-code/scripts/bake-chapters.mjs --resume # keep source pages already fetched
node mcps/west-virginia-code/scripts/upload-chapters.mjs # publish to R2 (statutes/wv/), changed files only
The source is the Legislature’s West Virginia Code; the site returns every section of one article in a single call, so the refresh makes one request per article (about 2,400), not one per section (about 31,000). Each article is checked against the site’s own list of its sections, and an article that returns fewer fails the run. Sequential, with a delay between requests, an honest user agent, bounded
retries, and a stop on the first 429/403/451. Exit 0 only if every chapter was fetched
and parsed and the totals clear the floors (default 120 chapters, 25,000 sections with text); anything less exits 1 with the
counts. A chapter whose text is unchanged keeps its previous data_as_of. The baked
files are a working copy, not committed (.bake/ is gitignored); upload-chapters.mjs
writes only the files whose content hash differs from the one recorded in
statutes/wv/_manifest.json, so a refresh that finds nothing new writes nothing. It
uses wrangler r2 object put --remote under the operator login; no API token.
Data source
West Virginia Legislature, West Virginia Code. West Virginia statutes are public record.
Tools
- wv_code_section — Get the FULL TEXT of a section of the West Virginia Code — West Virginia state law — by citation. “W. Va. Code 61-2-1” is first degree murder. Returns the statutory text. Keyless. Use for “what does W
Tools
wv_code_section— Get the FULL TEXT of a section of the West Virginia Code — West Virginia state law — by citation. W. Va. Code 61-2-1 is first degree murder. Returns the statutory text. Keyless. Use for what does West