@cyanheads/federal-regulations-mcp-server 0.1.4 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +3 -1
- package/CLAUDE.md +3 -1
- package/README.md +15 -6
- package/changelog/0.2.x/0.2.0.md +26 -0
- package/changelog/0.2.x/0.2.1.md +18 -0
- package/dist/mcp-server/resources/definitions/cfr-section.resource.d.ts +16 -1
- package/dist/mcp-server/resources/definitions/cfr-section.resource.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/cfr-section.resource.js +31 -8
- package/dist/mcp-server/resources/definitions/cfr-section.resource.js.map +1 -1
- package/dist/mcp-server/resources/definitions/document.resource.d.ts +12 -1
- package/dist/mcp-server/resources/definitions/document.resource.d.ts.map +1 -1
- package/dist/mcp-server/resources/definitions/document.resource.js +15 -0
- package/dist/mcp-server/resources/definitions/document.resource.js.map +1 -1
- package/dist/mcp-server/resources/definitions/index.d.ts +22 -2
- package/dist/mcp-server/resources/definitions/index.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/browse-cfr.tool.d.ts +4 -2
- package/dist/mcp-server/tools/definitions/browse-cfr.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/browse-cfr.tool.js +26 -8
- package/dist/mcp-server/tools/definitions/browse-cfr.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-cfr-section.tool.d.ts +30 -9
- package/dist/mcp-server/tools/definitions/get-cfr-section.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-cfr-section.tool.js +125 -24
- package/dist/mcp-server/tools/definitions/get-cfr-section.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/index.d.ts +24 -6
- package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
- package/dist/services/ecfr/cite.d.ts +23 -0
- package/dist/services/ecfr/cite.d.ts.map +1 -0
- package/dist/services/ecfr/cite.js +29 -0
- package/dist/services/ecfr/cite.js.map +1 -0
- package/dist/services/ecfr/ecfr-service.d.ts +45 -5
- package/dist/services/ecfr/ecfr-service.d.ts.map +1 -1
- package/dist/services/ecfr/ecfr-service.js +137 -35
- package/dist/services/ecfr/ecfr-service.js.map +1 -1
- package/dist/services/ecfr/types.d.ts +64 -0
- package/dist/services/ecfr/types.d.ts.map +1 -1
- package/dist/services/ecfr/xml.d.ts +38 -9
- package/dist/services/ecfr/xml.d.ts.map +1 -1
- package/dist/services/ecfr/xml.js +188 -33
- package/dist/services/ecfr/xml.js.map +1 -1
- package/dist/services/ecfr-mirror/ecfr-mirror.d.ts +24 -3
- package/dist/services/ecfr-mirror/ecfr-mirror.d.ts.map +1 -1
- package/dist/services/ecfr-mirror/ecfr-mirror.js +160 -32
- package/dist/services/ecfr-mirror/ecfr-mirror.js.map +1 -1
- package/dist/services/federal-register/federal-register-service.d.ts +3 -1
- package/dist/services/federal-register/federal-register-service.d.ts.map +1 -1
- package/dist/services/federal-register/federal-register-service.js +9 -6
- package/dist/services/federal-register/federal-register-service.js.map +1 -1
- package/dist/services/regulations-gov/regulations-gov-service.d.ts +2 -1
- package/dist/services/regulations-gov/regulations-gov-service.d.ts.map +1 -1
- package/dist/services/regulations-gov/regulations-gov-service.js +5 -3
- package/dist/services/regulations-gov/regulations-gov-service.js.map +1 -1
- package/dist/services/upstream-failure.d.ts +35 -0
- package/dist/services/upstream-failure.d.ts.map +1 -0
- package/dist/services/upstream-failure.js +51 -0
- package/dist/services/upstream-failure.js.map +1 -0
- package/package.json +1 -1
- package/scripts/_mirror-context.ts +16 -3
- package/scripts/ecfr-mirror-init.ts +20 -11
- package/scripts/ecfr-mirror-refresh.ts +9 -6
- package/scripts/ecfr-mirror-verify.ts +54 -25
- package/server.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** federal-regulations-mcp-server
|
|
4
|
-
**Version:** 0.1
|
|
4
|
+
**Version:** 0.2.1
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.1`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.30.0
|
|
@@ -230,6 +230,8 @@ scripts/
|
|
|
230
230
|
|
|
231
231
|
No prompts in v1 — `createApp({ prompts: [] })`.
|
|
232
232
|
|
|
233
|
+
**`scripts/` is typechecked, and one scaffolded script diverges because of it.** `tsconfig.json` includes `scripts/**/*` and `tests/**/*`, so `tsc --noEmit` reads every hand-written file — the mirror lifecycle scripts ship in `package.json` `files[]` and into the Docker runtime stage, so they are production code. `scripts/lint-mcp.ts` therefore drops the scaffold's `catch` branch importing `../src/linter/validate.js`: that path resolves only inside the framework's own repo, where the script also lives, so in this project the branch is unreachable and its type annotation cannot resolve. The `maintenance` skill re-syncs framework scripts by overwrite; re-drop the branch after a sync rather than narrowing the typecheck to hide it.
|
|
234
|
+
|
|
233
235
|
---
|
|
234
236
|
|
|
235
237
|
## Naming
|
package/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Developer Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** federal-regulations-mcp-server
|
|
4
|
-
**Version:** 0.1
|
|
4
|
+
**Version:** 0.2.1
|
|
5
5
|
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.1`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
7
|
**MCP SDK:** `@modelcontextprotocol/sdk` ^1.30.0
|
|
@@ -230,6 +230,8 @@ scripts/
|
|
|
230
230
|
|
|
231
231
|
No prompts in v1 — `createApp({ prompts: [] })`.
|
|
232
232
|
|
|
233
|
+
**`scripts/` is typechecked, and one scaffolded script diverges because of it.** `tsconfig.json` includes `scripts/**/*` and `tests/**/*`, so `tsc --noEmit` reads every hand-written file — the mirror lifecycle scripts ship in `package.json` `files[]` and into the Docker runtime stage, so they are production code. `scripts/lint-mcp.ts` therefore drops the scaffold's `catch` branch importing `../src/linter/validate.js`: that path resolves only inside the framework's own repo, where the script also lives, so in this project the branch is unreachable and its type annotation cannot resolve. The `maintenance` skill re-syncs framework scripts by overwrite; re-drop the branch after a sync rather than narrowing the typecheck to hide it.
|
|
234
|
+
|
|
233
235
|
---
|
|
234
236
|
|
|
235
237
|
## Naming
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/federal-regulations-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/federal-regulations-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -40,7 +40,7 @@ Seven tools across the regulatory workflow. The **Federal Register** and **eCFR*
|
|
|
40
40
|
| `regulations_search_rules` | Federal Register | — | Search proposed rules, final rules, notices, and presidential documents by query, type, agency, date range, and open-for-comment status. The primary discovery entry point. |
|
|
41
41
|
| `regulations_get_document` | Federal Register | — | Fetch one FR document by number — full metadata plus the cross-source handles (docket ID, CFR parts, comment count) that chain into the comment and codified-text tools. |
|
|
42
42
|
| `regulations_browse_cfr` | eCFR | — | Walk the CFR hierarchy (structure mode) or full-text-search the codified CFR (search mode). Both feed `regulations_get_cfr_section`. |
|
|
43
|
-
| `regulations_get_cfr_section` | eCFR | — | Read the codified text
|
|
43
|
+
| `regulations_get_cfr_section` | eCFR | — | Read the codified text at a CFR location — a section, a whole part, or an appendix — current or as of a past date. |
|
|
44
44
|
| `regulations_get_docket` | Regulations.gov | ✔ | Pull a rulemaking docket and the documents filed in it (NPRM, final rule, supporting materials). |
|
|
45
45
|
| `regulations_find_comments` | Regulations.gov | ✔ | Fetch public comments on a document or docket, or one comment's full body and attachments. Flags attachment-only submissions. |
|
|
46
46
|
| `regulations_list_open_comments` | Federal Register (+ Reg.gov enrich) | optional | Rules currently open for public comment, closing soonest first. Fully functional keyless; enriches comment counts when keyed. |
|
|
@@ -79,17 +79,22 @@ Explore the codified Code of Federal Regulations via eCFR in two modes. Keyless.
|
|
|
79
79
|
- Search is served from the synced local mirror (FTS5) only when the mirror's title coverage can answer the request — a title it does not hold, an all-titles query against a scoped mirror, a `date`, or a cold deploy all go to the live eCFR search API instead
|
|
80
80
|
- Every search result reports `source` (`mirror` or `live`) and `sourceScope` — which corpus answered and what it covers, so an empty result is never mistaken for "no such regulation"
|
|
81
81
|
- `date` searches the section text in effect that day; eCFR indexes 2017-01-03 onward, and an undated search is pinned to eCFR's current index date rather than spanning every historical version
|
|
82
|
-
- Both modes assemble a `cfrCite` that feeds `regulations_get_cfr_section`
|
|
82
|
+
- Both modes assemble a `cfrCite` that feeds `regulations_get_cfr_section`, and both hand appendices back the same way: an `appendix` field with eCFR's verbatim identifier, and a cite that names the appendix rather than the part around it
|
|
83
|
+
- The mirror indexes section text only, so it never matches an appendix — its `sourceScope` says so, since otherwise an appendix that exists and one that does not both read as zero matches
|
|
83
84
|
|
|
84
85
|
---
|
|
85
86
|
|
|
86
87
|
### `regulations_get_cfr_section`
|
|
87
88
|
|
|
88
|
-
Read the codified text
|
|
89
|
+
Read the codified text at a CFR location — one section, a whole part, or one appendix — via eCFR. Keyless.
|
|
89
90
|
|
|
90
91
|
- Answers "what does 40 CFR 50.1 say today?" and "...as of 2019-01-01?" — pass `date` for point-in-time text
|
|
91
92
|
- Provide `title` + `part` + `section` for one section, or omit `section` to fetch the whole part
|
|
92
|
-
-
|
|
93
|
+
- Provide `appendix` to read an appendix, passing the identifier verbatim as `regulations_browse_cfr` emits it (`Appendix A-1 to Part 50`, `Schedule I to Part 789`, `Special Federal Aviation Regulation No. 88`) — the identifiers are prose, not letters, and a short form matches nothing
|
|
94
|
+
- A whole-part read names the part's appendices and their headings but does not inline their text; appendices routinely run several times the length of the sections around them, so reading one is a deliberate second call
|
|
95
|
+
- Current single-section reads are served from the local mirror when ready (the `source` is reported); historical dates, whole-part fetches, appendix reads, and a cold mirror fall back to the live eCFR versioner
|
|
96
|
+
- The text carries what the XML carries: paragraphs, subheadings, editorial notes, tables (one pipe-delimited line per row), figure references, and the trailing source citation — the bracketed Federal Register history (`[36 FR 22384, Nov. 25, 1971, as amended at 81 FR 68276, Oct. 3, 2016]`) that leads back to the rulemakings behind the text
|
|
97
|
+
- A cite that names nothing returns the tool's not-found error with a recovery hint pointing at `regulations_browse_cfr` structure mode, not a bare upstream status
|
|
93
98
|
- eCFR retains historical versions back to roughly 2017; a date before coverage is rejected with guidance
|
|
94
99
|
|
|
95
100
|
---
|
|
@@ -318,10 +323,14 @@ ECFR_MIRROR_TITLES=21,40 bun run mirror:init
|
|
|
318
323
|
# Incremental refresh against the latest eCFR issues
|
|
319
324
|
bun run mirror:refresh
|
|
320
325
|
|
|
321
|
-
# Report row counts
|
|
326
|
+
# Report row counts, the last-synced issue date, and whether the index is stale
|
|
322
327
|
bun run mirror:verify
|
|
323
328
|
```
|
|
324
329
|
|
|
330
|
+
**A sync pass deletes only what it read in full.** Each title's pass removes the rows the pass did not rewrite — how a withdrawn section leaves the index. A response that arrives cut short parses to a prefix of the title, which is indistinguishable from a title that shrank, so the pass first checks that the document it read is whole (its root element is closed) and leaves the title untouched when it is not, rather than deleting everything past the cut and reporting the run complete.
|
|
331
|
+
|
|
332
|
+
**An index written by an older ingester is not served.** The ingester stamps a version into the mirror once a run has re-derived every title the index holds; when a release changes how rows are derived, an index carrying an older stamp is treated exactly like a cold one — every read falls back to live eCFR until `bun run mirror:refresh` re-derives it. `mirror:verify` says so explicitly, and a refresh removes the rows the previous ingester filed under keys the current one no longer produces. A run that skips a title — a failed fetch, or an `ECFR_MIRROR_TITLES` scope narrower than the index — names it in the log and leaves the stamp unwritten, because those untouched titles are exactly the ones a stamp would certify wrongly.
|
|
333
|
+
|
|
325
334
|
Until the mirror has completed an init, the codified-text tools run against the live eCFR API — so the server is useful immediately on a fresh deploy; the mirror is a latency/throughput optimization, not a hard dependency. On the HTTP transport a weekly refresh is scheduled automatically (`ECFR_MIRROR_REFRESH_CRON`); stdio operators run the lifecycle scripts above.
|
|
326
335
|
|
|
327
336
|
The mirror database (`./data/ecfr-mirror.sqlite`) is a local artifact — it is git-ignored and excluded from the `.mcpb` bundle, never shipped in the package.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "regulations_get_cfr_section reads CFR appendices by verbatim identifier, with appendix handles surfaced from regulations_browse_cfr; the eCFR mirror now files dotless-numbered sections under their correct part and versions its ingest so stale rows fall back to live eCFR."
|
|
3
|
+
breaking: true
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.2.0 — 2026-08-10
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **`regulations_get_cfr_section` `appendix` input** — reads one CFR appendix by its verbatim identifier (`title` + `appendix`, `part` optional but disambiguating); adds `appendix` and `appendices` (a whole-part read's un-inlined appendix identifiers + headings) to the output, plus `location_required` and `conflicting_target` error reasons. ([#6](https://github.com/cyanheads/federal-regulations-mcp-server/issues/6))
|
|
12
|
+
- **`regulations_browse_cfr`** — structure nodes and search hits carry an `appendix` field; an appendix's `cfrCite` now names the appendix itself, not the part around it. ([#6](https://github.com/cyanheads/federal-regulations-mcp-server/issues/6))
|
|
13
|
+
- **`mirror:verify`** — reports whether the index was written by the current ingester, naming `mirror:refresh` as the fix when it wasn't. ([#9](https://github.com/cyanheads/federal-regulations-mcp-server/issues/9))
|
|
14
|
+
|
|
15
|
+
## Changed
|
|
16
|
+
|
|
17
|
+
- **`regulations_get_cfr_section` `part`** — input is now optional (required unless `appendix` is given); output `part` is nullable. **Breaking**: a caller assuming `part` is always a non-null string must now handle `null` (an appendix hanging off a chapter, subchapter, or subtitle rather than a part).
|
|
18
|
+
- **CFR cites** — a section or appendix cite now names its enclosing part explicitly when the section number doesn't embed it (`14 CFR 241 § 25`, not `14 CFR 25`), applied uniformly to live hits, mirror hits, the read tool, and the `regulations://cfr/{title}/{part}/{section}` resource. ([#9](https://github.com/cyanheads/federal-regulations-mcp-server/issues/9))
|
|
19
|
+
- **eCFR body-text extraction** — keeps `<HD1>`–`<HD7>` subheadings, `<TABLE>` rows (pipe-delimited), the flush-paragraph family (`<FP-1>`, `<FP1-2>`), and an editorial note's `<HED>`/`<PSPACE>`, for sections and appendices alike; previously only `<P>`/`<FP>` paragraphs were kept, which answered 61% of appendix nodes in a sample with an empty body. ([#6](https://github.com/cyanheads/federal-regulations-mcp-server/issues/6))
|
|
20
|
+
|
|
21
|
+
## Fixed
|
|
22
|
+
|
|
23
|
+
- **eCFR mirror ingest** — a section's part now comes from its enclosing `<DIV5 TYPE="PART">` element instead of the section number cut at its first dot; a part with dotless section identifiers (14 CFR 241: `Section 25`, `Sec. 1-1`) was filing rows under a part named after the section number, so a scoped search or cite could return an unrelated regulation's text. ([#9](https://github.com/cyanheads/federal-regulations-mcp-server/issues/9))
|
|
24
|
+
- **Mirror ingest versioning** — the ingester now stamps an `ingest_version`; rows from a superseded ingester are treated as not ready (every read falls back to live eCFR until `mirror:refresh` re-derives them), and a refresh tombstones rows it no longer writes so corrected or withdrawn rows don't survive beside the fix. ([#9](https://github.com/cyanheads/federal-regulations-mcp-server/issues/9))
|
|
25
|
+
- **`mirror:verify`** — its sample query was passing its result limit into the `part` filter added in 0.1.4, leaving the limit unset. ([#9](https://github.com/cyanheads/federal-regulations-mcp-server/issues/9))
|
|
26
|
+
- **XML paragraph parsing** — a malformed `<FP-1>`/`<FP-2>` closing-tag match could swallow up to 257 KB of content, every paragraph and subheading up to the next plain `</FP>` in the document. ([#6](https://github.com/cyanheads/federal-regulations-mcp-server/issues/6))
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Declared not_found/upstream_unavailable/title_not_found reasons now reach callers on every tool and resource, the eCFR mirror guards against ingesting truncated title documents, CFR body text carries source citations and figure references (mirror re-ingest required), and scripts/ plus tests/ are now typechecked."
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.2.1 — 2026-08-10
|
|
8
|
+
|
|
9
|
+
## Changed
|
|
10
|
+
|
|
11
|
+
- **`regulations_get_cfr_section` `bodyText`** — carries the trailing `<CITA>` Federal Register source citation and `[Figure: /graphics/…]` references now, in document order; previously dropped entirely. Measured across four whole CFR titles (2,994 sections, 143 appendices): section bodies grew 1.48% in total (mean +37 characters, 41% of sections affected), appendix bodies grew 6.4%, and the 77 appendices in the sample that read back blank dropped to zero — empty `bodyText` is now reserved for a true `[Reserved]` placeholder. **eCFR mirror `INGEST_VERSION` moves to 3** for this change: an existing local mirror is treated as stale until `bun run mirror:refresh` re-derives it, and reads fall back to live eCFR in the meantime. ([#13](https://github.com/cyanheads/federal-regulations-mcp-server/issues/13))
|
|
12
|
+
|
|
13
|
+
## Fixed
|
|
14
|
+
|
|
15
|
+
- **`regulations_get_cfr_section` / `regulations://cfr/{title}/{part}/{section}`** — a nonexistent section, whole part, or resource cite now raises the declared `not_found` reason with its recovery hint (verify via `regulations_browse_cfr` structure mode), instead of a bare message with a null `data.reason`. ([#11](https://github.com/cyanheads/federal-regulations-mcp-server/issues/11))
|
|
16
|
+
- **`upstream_unavailable`** — every tool and resource that declares it now raises it: a transport failure (5xx, timeout, HTML error page) surviving retry is stamped with the reason and the definition's own recovery hint via a shared `withUpstreamReason` helper, instead of reaching the caller with a null `data.reason`. Also newly attached: `regulations_get_document` `not_found` on a Federal Register 404, and `regulations_browse_cfr` `title_not_found` now also covers a title the versioner publishes no structure tree for at all (a reserved title, or a date outside its coverage), not only a missing part. ([#14](https://github.com/cyanheads/federal-regulations-mcp-server/issues/14))
|
|
17
|
+
- **eCFR mirror sync** — a title document that arrives truncated (a dropped stream, a proxy serving the first N bytes with a 200) is now detected via `isCompleteXmlDocument` and left untouched, rather than having every section past the cut tombstoned as withdrawn; the run previously reported `complete` over a silently gutted title. ([#12](https://github.com/cyanheads/federal-regulations-mcp-server/issues/12))
|
|
18
|
+
- **`scripts/` and `tests/`** — no longer exempt from the TypeScript gate: `tsconfig.json` `include` widens to `["src/**/*", "scripts/**/*", "tests/**/*"]` (`tsconfig.build.json` keeps its own narrower `include: ["src/**/*"]`, so `dist/` output is unchanged). Fixed the 99 errors the widened check surfaced, including a `HandlerContext<Reason>` mismatch across contract-declaring tool tests, now centralized in `tests/helpers/handler-context.ts`, and a dead framework-only import branch in `scripts/lint-mcp.ts`. ([#10](https://github.com/cyanheads/federal-regulations-mcp-server/issues/10))
|
|
@@ -3,12 +3,27 @@
|
|
|
3
3
|
* current CFR section, the same payload as regulations_get_cfr_section at the
|
|
4
4
|
* current date, for clients that support injectable context. Mirror-backed with a
|
|
5
5
|
* live eCFR fallback. Every datum is also reachable through the tool surface.
|
|
6
|
+
*
|
|
7
|
+
* Sections only. An appendix is addressed by a free-form phrase ("Appendix A-1
|
|
8
|
+
* to Part 50"), not by a path segment, so it stays on the tool surface rather
|
|
9
|
+
* than becoming a URI template whose last component is an encoded sentence.
|
|
6
10
|
* @module mcp-server/resources/definitions/cfr-section.resource
|
|
7
11
|
*/
|
|
8
12
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
13
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
9
14
|
export declare const cfrSectionResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
|
|
10
15
|
title: z.ZodString;
|
|
11
16
|
part: z.ZodString;
|
|
12
17
|
section: z.ZodString;
|
|
13
|
-
}, z.core.$strip>, undefined,
|
|
18
|
+
}, z.core.$strip>, undefined, readonly [{
|
|
19
|
+
readonly reason: "not_found";
|
|
20
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
21
|
+
readonly when: "No such title/part/section in the current CFR.";
|
|
22
|
+
readonly recovery: "Verify the cite with regulations_browse_cfr (structure mode); the part or section may not exist or may be reserved.";
|
|
23
|
+
}, {
|
|
24
|
+
readonly reason: "upstream_unavailable";
|
|
25
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
26
|
+
readonly when: "eCFR returned a 5xx, timed out, or served an HTML error page (live path, mirror not ready or missing the section).";
|
|
27
|
+
readonly recovery: "Retry after a brief wait; the eCFR API may be momentarily unavailable.";
|
|
28
|
+
}]>;
|
|
14
29
|
//# sourceMappingURL=cfr-section.resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cfr-section.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/cfr-section.resource.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cfr-section.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/cfr-section.resource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;GAsG7B,CAAC"}
|
|
@@ -3,16 +3,21 @@
|
|
|
3
3
|
* current CFR section, the same payload as regulations_get_cfr_section at the
|
|
4
4
|
* current date, for clients that support injectable context. Mirror-backed with a
|
|
5
5
|
* live eCFR fallback. Every datum is also reachable through the tool surface.
|
|
6
|
+
*
|
|
7
|
+
* Sections only. An appendix is addressed by a free-form phrase ("Appendix A-1
|
|
8
|
+
* to Part 50"), not by a path segment, so it stays on the tool surface rather
|
|
9
|
+
* than becoming a URI template whose last component is an encoded sentence.
|
|
6
10
|
* @module mcp-server/resources/definitions/cfr-section.resource
|
|
7
11
|
*/
|
|
8
12
|
import { resource, z } from '@cyanheads/mcp-ts-core';
|
|
9
|
-
import {
|
|
13
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
14
|
+
import { sectionCite } from '../../../services/ecfr/cite.js';
|
|
10
15
|
import { getEcfrService } from '../../../services/ecfr/ecfr-service.js';
|
|
11
16
|
import { mirrorGetSection, mirrorReady } from '../../../services/ecfr-mirror/ecfr-mirror.js';
|
|
12
17
|
export const cfrSectionResource = resource('regulations://cfr/{title}/{part}/{section}', {
|
|
13
18
|
name: 'cfr-section',
|
|
14
19
|
title: 'CFR section (current)',
|
|
15
|
-
description: 'Codified text of a current CFR section by title/part/section (e.g. regulations://cfr/40/50/50.1). Mirrors regulations_get_cfr_section at the current date — mirror-backed with a live eCFR fallback.',
|
|
20
|
+
description: 'Codified text of a current CFR section by title/part/section (e.g. regulations://cfr/40/50/50.1). Mirrors regulations_get_cfr_section at the current date — mirror-backed with a live eCFR fallback. Sections only; read an appendix through regulations_get_cfr_section with its `appendix` input.',
|
|
16
21
|
mimeType: 'application/json',
|
|
17
22
|
params: z.object({
|
|
18
23
|
title: z
|
|
@@ -22,18 +27,33 @@ export const cfrSectionResource = resource('regulations://cfr/{title}/{part}/{se
|
|
|
22
27
|
part: z.string().describe('CFR part (e.g. "50").'),
|
|
23
28
|
section: z.string().describe('Section identifier (e.g. "50.1").'),
|
|
24
29
|
}),
|
|
30
|
+
errors: [
|
|
31
|
+
{
|
|
32
|
+
reason: 'not_found',
|
|
33
|
+
code: JsonRpcErrorCode.NotFound,
|
|
34
|
+
when: 'No such title/part/section in the current CFR.',
|
|
35
|
+
recovery: 'Verify the cite with regulations_browse_cfr (structure mode); the part or section may not exist or may be reserved.',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
reason: 'upstream_unavailable',
|
|
39
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
40
|
+
when: 'eCFR returned a 5xx, timed out, or served an HTML error page (live path, mirror not ready or missing the section).',
|
|
41
|
+
recovery: 'Retry after a brief wait; the eCFR API may be momentarily unavailable.',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
25
44
|
async handler(params, ctx) {
|
|
26
45
|
const titleNum = Number.parseInt(params.title, 10);
|
|
27
46
|
const service = getEcfrService();
|
|
28
47
|
if (await mirrorReady()) {
|
|
29
48
|
const hit = await mirrorGetSection(titleNum, params.part, params.section);
|
|
30
49
|
if (hit) {
|
|
31
|
-
const hierarchyPath = await service.hierarchyPath(titleNum, params.part, params.section, hit.date, ctx);
|
|
50
|
+
const hierarchyPath = await service.hierarchyPath(titleNum, { part: params.part, section: params.section }, hit.date, ctx);
|
|
32
51
|
return {
|
|
33
|
-
cfrCite:
|
|
52
|
+
cfrCite: sectionCite(titleNum, params.part, params.section),
|
|
34
53
|
title: titleNum,
|
|
35
54
|
part: params.part,
|
|
36
55
|
section: params.section,
|
|
56
|
+
appendix: null,
|
|
37
57
|
heading: hit.heading,
|
|
38
58
|
hierarchyPath,
|
|
39
59
|
date: hit.date,
|
|
@@ -44,19 +64,22 @@ export const cfrSectionResource = resource('regulations://cfr/{title}/{part}/{se
|
|
|
44
64
|
}
|
|
45
65
|
const date = await service.latestIssueDate(titleNum, ctx);
|
|
46
66
|
const result = await service.getSectionText(titleNum, params.part, params.section, date, ctx);
|
|
47
|
-
if (!result
|
|
48
|
-
throw
|
|
67
|
+
if (!result?.bodyText) {
|
|
68
|
+
throw ctx.fail('not_found', `No codified text found for ${sectionCite(titleNum, params.part, params.section)} as of ${date}.`, {
|
|
69
|
+
...ctx.recoveryFor('not_found'),
|
|
49
70
|
title: titleNum,
|
|
50
71
|
part: params.part,
|
|
51
72
|
section: params.section,
|
|
73
|
+
date,
|
|
52
74
|
});
|
|
53
75
|
}
|
|
54
|
-
const hierarchyPath = await service.hierarchyPath(titleNum, params.part, params.section, result.date, ctx);
|
|
76
|
+
const hierarchyPath = await service.hierarchyPath(titleNum, { part: params.part, section: params.section }, result.date, ctx);
|
|
55
77
|
return {
|
|
56
|
-
cfrCite:
|
|
78
|
+
cfrCite: sectionCite(titleNum, params.part, params.section),
|
|
57
79
|
title: titleNum,
|
|
58
80
|
part: params.part,
|
|
59
81
|
section: params.section,
|
|
82
|
+
appendix: null,
|
|
60
83
|
heading: result.heading,
|
|
61
84
|
hierarchyPath,
|
|
62
85
|
date: result.date,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cfr-section.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/cfr-section.resource.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cfr-section.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/cfr-section.resource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEtF,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,4CAA4C,EAAE;IACvF,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EACT,qSAAqS;IACvS,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,KAAK,CAAC,WAAW,CAAC;aAClB,QAAQ,CAAC,0BAA0B,CAAC;QACvC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QAClD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;KAClE,CAAC;IACF,MAAM,EAAE;QACN;YACE,MAAM,EAAE,WAAW;YACnB,IAAI,EAAE,gBA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YACT;gBACE,GAAG,EAAE,8BAA8B;gBACnC,IAAI,EAAE,mCAAmC;gBACzC,QAAQ,EAAE,kBAAkB;aAC7B;SACF;KACF,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -6,7 +6,18 @@
|
|
|
6
6
|
* @module mcp-server/resources/definitions/document.resource
|
|
7
7
|
*/
|
|
8
8
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
9
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
9
10
|
export declare const documentResource: import("@cyanheads/mcp-ts-core").ResourceDefinition<z.ZodObject<{
|
|
10
11
|
documentNumber: z.ZodString;
|
|
11
|
-
}, z.core.$strip>, undefined,
|
|
12
|
+
}, z.core.$strip>, undefined, readonly [{
|
|
13
|
+
readonly reason: "not_found";
|
|
14
|
+
readonly code: JsonRpcErrorCode.NotFound;
|
|
15
|
+
readonly when: "No Federal Register document exists with that number.";
|
|
16
|
+
readonly recovery: "Verify the number via regulations_search_rules; FR numbers look like \"2025-14555\".";
|
|
17
|
+
}, {
|
|
18
|
+
readonly reason: "upstream_unavailable";
|
|
19
|
+
readonly code: JsonRpcErrorCode.ServiceUnavailable;
|
|
20
|
+
readonly when: "Federal Register returned a 5xx, timed out, or served an HTML error page.";
|
|
21
|
+
readonly recovery: "Retry after a brief wait; the Federal Register API may be momentarily down.";
|
|
22
|
+
}]>;
|
|
12
23
|
//# sourceMappingURL=document.resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/document.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"document.resource.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/document.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAY,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;GA6C3B,CAAC"}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* @module mcp-server/resources/definitions/document.resource
|
|
7
7
|
*/
|
|
8
8
|
import { resource, z } from '@cyanheads/mcp-ts-core';
|
|
9
|
+
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
9
10
|
import { getFederalRegisterService } from '../../../services/federal-register/federal-register-service.js';
|
|
10
11
|
export const documentResource = resource('regulations://document/{documentNumber}', {
|
|
11
12
|
name: 'federal-register-document',
|
|
@@ -18,6 +19,20 @@ export const documentResource = resource('regulations://document/{documentNumber
|
|
|
18
19
|
.regex(/^[0-9]{4}-[0-9]+$/)
|
|
19
20
|
.describe('Federal Register document number (e.g. "2025-14555").'),
|
|
20
21
|
}),
|
|
22
|
+
errors: [
|
|
23
|
+
{
|
|
24
|
+
reason: 'not_found',
|
|
25
|
+
code: JsonRpcErrorCode.NotFound,
|
|
26
|
+
when: 'No Federal Register document exists with that number.',
|
|
27
|
+
recovery: 'Verify the number via regulations_search_rules; FR numbers look like "2025-14555".',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
reason: 'upstream_unavailable',
|
|
31
|
+
code: JsonRpcErrorCode.ServiceUnavailable,
|
|
32
|
+
when: 'Federal Register returned a 5xx, timed out, or served an HTML error page.',
|
|
33
|
+
recovery: 'Retry after a brief wait; the Federal Register API may be momentarily down.',
|
|
34
|
+
},
|
|
35
|
+
],
|
|
21
36
|
async handler(params, ctx) {
|
|
22
37
|
const service = getFederalRegisterService();
|
|
23
38
|
const detail = await service.getDocument(params.documentNumber, false, ctx);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/document.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yDAAyD,CAAC;AAEpG,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC,yCAAyC,EAAE;IAClF,IAAI,EAAE,2BAA2B;IACjC,KAAK,EAAE,2BAA2B;IAClC,WAAW,EACT,mPAAmP;IACrP,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,KAAK,CAAC,mBAAmB,CAAC;aAC1B,QAAQ,CAAC,uDAAuD,CAAC;KACrE,CAAC;
|
|
1
|
+
{"version":3,"file":"document.resource.js","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/document.resource.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yDAAyD,CAAC;AAEpG,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC,yCAAyC,EAAE;IAClF,IAAI,EAAE,2BAA2B;IACjC,KAAK,EAAE,2BAA2B;IAClC,WAAW,EACT,mPAAmP;IACrP,QAAQ,EAAE,kBAAkB;IAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,KAAK,CAAC,mBAAmB,CAAC;aAC1B,QAAQ,CAAC,uDAAuD,CAAC;KACrE,CAAC;IACF,MAAM,EAAE;QACN;YACE,MAAM,EAAE,WAAW;YACnB,IAAI,EAAE,gBAAgB,CAAC,QAAQ;YAC/B,IAAI,EAAE,uDAAuD;YAC7D,QAAQ,EACN,oFAAoF;SACvF;QACD;YACE,MAAM,EAAE,sBAAsB;YAC9B,IAAI,EAAE,gBAAgB,CAAC,kBAAkB;YACzC,IAAI,EAAE,2EAA2E;YACjF,QAAQ,EAAE,6EAA6E;SACxF;KACF;IAED,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG;QACvB,MAAM,OAAO,GAAG,yBAAyB,EAAE,CAAC;QAC5C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,cAAc,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAC5E,6EAA6E;QAC7E,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC5C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;QACX,SAAS,EAAE;YACT;gBACE,GAAG,EAAE,mCAAmC;gBACxC,IAAI,EAAE,mCAAmC;gBACzC,QAAQ,EAAE,kBAAkB;aAC7B;SACF;KACF,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -6,7 +6,27 @@ export declare const allResourceDefinitions: (import("@cyanheads/mcp-ts-core").R
|
|
|
6
6
|
title: import("zod").ZodString;
|
|
7
7
|
part: import("zod").ZodString;
|
|
8
8
|
section: import("zod").ZodString;
|
|
9
|
-
}, import("zod/v4/core").$strip>, undefined,
|
|
9
|
+
}, import("zod/v4/core").$strip>, undefined, readonly [{
|
|
10
|
+
readonly reason: "not_found";
|
|
11
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
12
|
+
readonly when: "No such title/part/section in the current CFR.";
|
|
13
|
+
readonly recovery: "Verify the cite with regulations_browse_cfr (structure mode); the part or section may not exist or may be reserved.";
|
|
14
|
+
}, {
|
|
15
|
+
readonly reason: "upstream_unavailable";
|
|
16
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
17
|
+
readonly when: "eCFR returned a 5xx, timed out, or served an HTML error page (live path, mirror not ready or missing the section).";
|
|
18
|
+
readonly recovery: "Retry after a brief wait; the eCFR API may be momentarily unavailable.";
|
|
19
|
+
}]> | import("@cyanheads/mcp-ts-core").ResourceDefinition<import("zod").ZodObject<{
|
|
10
20
|
documentNumber: import("zod").ZodString;
|
|
11
|
-
}, import("zod/v4/core").$strip>, undefined,
|
|
21
|
+
}, import("zod/v4/core").$strip>, undefined, readonly [{
|
|
22
|
+
readonly reason: "not_found";
|
|
23
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.NotFound;
|
|
24
|
+
readonly when: "No Federal Register document exists with that number.";
|
|
25
|
+
readonly recovery: "Verify the number via regulations_search_rules; FR numbers look like \"2025-14555\".";
|
|
26
|
+
}, {
|
|
27
|
+
readonly reason: "upstream_unavailable";
|
|
28
|
+
readonly code: import("@cyanheads/mcp-ts-core/errors").JsonRpcErrorCode.ServiceUnavailable;
|
|
29
|
+
readonly when: "Federal Register returned a 5xx, timed out, or served an HTML error page.";
|
|
30
|
+
readonly recovery: "Retry after a brief wait; the Federal Register API may be momentarily down.";
|
|
31
|
+
}]>)[];
|
|
12
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/resources/definitions/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;MAAyC,CAAC"}
|
|
@@ -37,6 +37,7 @@ export declare const browseCfrTool: import("@cyanheads/mcp-ts-core").ToolDefinit
|
|
|
37
37
|
description: z.ZodNullable<z.ZodString>;
|
|
38
38
|
reserved: z.ZodBoolean;
|
|
39
39
|
cfrCite: z.ZodNullable<z.ZodString>;
|
|
40
|
+
appendix: z.ZodNullable<z.ZodString>;
|
|
40
41
|
}, z.core.$strip>>>;
|
|
41
42
|
source: z.ZodOptional<z.ZodEnum<{
|
|
42
43
|
live: "live";
|
|
@@ -47,6 +48,7 @@ export declare const browseCfrTool: import("@cyanheads/mcp-ts-core").ToolDefinit
|
|
|
47
48
|
title: z.ZodNumber;
|
|
48
49
|
part: z.ZodString;
|
|
49
50
|
section: z.ZodNullable<z.ZodString>;
|
|
51
|
+
appendix: z.ZodNullable<z.ZodString>;
|
|
50
52
|
heading: z.ZodString;
|
|
51
53
|
hierarchyPath: z.ZodString;
|
|
52
54
|
excerpt: z.ZodString;
|
|
@@ -60,8 +62,8 @@ export declare const browseCfrTool: import("@cyanheads/mcp-ts-core").ToolDefinit
|
|
|
60
62
|
}, {
|
|
61
63
|
readonly reason: "title_not_found";
|
|
62
64
|
readonly code: JsonRpcErrorCode.NotFound;
|
|
63
|
-
readonly when: "Structure mode
|
|
64
|
-
readonly recovery: "Omit
|
|
65
|
+
readonly when: "Structure mode where eCFR publishes no tree for the title at that date (a reserved title, or a date outside its coverage), or where the part is absent from the tree it does publish.";
|
|
66
|
+
readonly recovery: "Omit part to list the whole title, or omit both to list every title; a reserved title and a date before ~2017 publish no tree at all.";
|
|
65
67
|
}, {
|
|
66
68
|
readonly reason: "title_required_for_part";
|
|
67
69
|
readonly code: JsonRpcErrorCode.InvalidParams;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browse-cfr.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/browse-cfr.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"browse-cfr.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/browse-cfr.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAyHjE,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2PxB,CAAC"}
|
|
@@ -27,7 +27,9 @@ function filterClause(title, part) {
|
|
|
27
27
|
/** Human-readable coverage of the mirror index, for the `sourceScope` field. */
|
|
28
28
|
function describeMirrorScope(scope, title, part) {
|
|
29
29
|
const held = scope.complete ? 'all CFR titles' : `CFR titles ${scope.titles.join(', ')}`;
|
|
30
|
-
|
|
30
|
+
// The index holds section text alone, so an appendix match cannot come back
|
|
31
|
+
// from it — which is indistinguishable from no such appendix unless said.
|
|
32
|
+
return `Local mirror index — ${held}${filterClause(title, part)}, current section text only; appendices are not indexed, so no result here is evidence about them.`;
|
|
31
33
|
}
|
|
32
34
|
/** Human-readable coverage of the live eCFR search index, for `sourceScope`. */
|
|
33
35
|
function describeLiveScope(date, title, part) {
|
|
@@ -65,7 +67,11 @@ const structureNode = z
|
|
|
65
67
|
cfrCite: z
|
|
66
68
|
.string()
|
|
67
69
|
.nullable()
|
|
68
|
-
.describe('Assembled cite for a part
|
|
70
|
+
.describe('Assembled cite → regulations_get_cfr_section: "40 CFR 50" / "40 CFR 50.1" for a part or section, "Appendix A-1 to Part 50, Title 40" for an appendix. Null on a level with no read path (chapter, subchapter, subpart, subject group).'),
|
|
71
|
+
appendix: z
|
|
72
|
+
.string()
|
|
73
|
+
.nullable()
|
|
74
|
+
.describe('On an appendix node, the identifier to pass straight back as regulations_get_cfr_section\'s `appendix` input; null on every other node type. It is free-form prose, not a letter ("Schedule I to Part 789", "Special Federal Aviation Regulation No. 88"), so pass it verbatim rather than abbreviating it.'),
|
|
69
75
|
})
|
|
70
76
|
.describe('One hierarchy node.');
|
|
71
77
|
const searchHit = z
|
|
@@ -76,6 +82,10 @@ const searchHit = z
|
|
|
76
82
|
.string()
|
|
77
83
|
.nullable()
|
|
78
84
|
.describe('Section identifier, or null when the match is an appendix or a whole part.'),
|
|
85
|
+
appendix: z
|
|
86
|
+
.string()
|
|
87
|
+
.nullable()
|
|
88
|
+
.describe("On an appendix hit, the identifier to pass straight back as regulations_get_cfr_section's `appendix` input; null on a section hit. Always null on a mirror hit — the index holds section text only, so mirror-sourced results never match an appendix."),
|
|
79
89
|
heading: z
|
|
80
90
|
.string()
|
|
81
91
|
.describe('What the matched node is called — the section, appendix, or part heading. Distinct from cfrCite, which is where it lives.'),
|
|
@@ -83,9 +93,11 @@ const searchHit = z
|
|
|
83
93
|
.string()
|
|
84
94
|
.describe('Path down to the match. A live hit names the part it sits in — "Title 40 › Chapter I › Subchapter C › Part 51 — Requirements for Preparation, Adoption, and Submittal of Implementation Plans › § 51.190" — so the subject matter is readable without a second call. A mirror hit is structural only ("Title 14 › Part 25 › § 25.1043"): the index stores no level names. Check `source` before comparing paths across results.'),
|
|
85
95
|
excerpt: z.string().describe('Matched text snippet.'),
|
|
86
|
-
cfrCite: z
|
|
96
|
+
cfrCite: z
|
|
97
|
+
.string()
|
|
98
|
+
.describe('Assembled cite → regulations_get_cfr_section. A section hit cites the section ("40 CFR 51.190"); an appendix hit cites the appendix in eCFR\'s own form ("Appendix C to Part 58, Title 40"), not the part around it, since the part\'s sections do not contain the matched text.'),
|
|
87
99
|
})
|
|
88
|
-
.describe('One matching CFR section.');
|
|
100
|
+
.describe('One matching CFR section or appendix.');
|
|
89
101
|
export const browseCfrTool = tool('regulations_browse_cfr', {
|
|
90
102
|
title: 'regulations_browse_cfr',
|
|
91
103
|
description: 'Explore the codified Code of Federal Regulations via eCFR in two modes. "structure" walks the CFR hierarchy (all 50 titles, or one title\'s chapters → parts → sections) to discover a cite when the exact citation is unknown. "search" runs a full-text query across the codified CFR and returns matching sections with their hierarchy path and a snippet. Both modes accept title and part to narrow the scope, so a part surfaced by structure mode can be searched directly instead of filtering a whole title\'s hits by eye. Both feed regulations_get_cfr_section. Every search result reports which corpus answered it — the synced local mirror or the live eCFR index — and what that corpus covers, in `source` and `sourceScope`.',
|
|
@@ -170,8 +182,8 @@ export const browseCfrTool = tool('regulations_browse_cfr', {
|
|
|
170
182
|
{
|
|
171
183
|
reason: 'title_not_found',
|
|
172
184
|
code: JsonRpcErrorCode.NotFound,
|
|
173
|
-
when: 'Structure mode
|
|
174
|
-
recovery: 'Omit
|
|
185
|
+
when: 'Structure mode where eCFR publishes no tree for the title at that date (a reserved title, or a date outside its coverage), or where the part is absent from the tree it does publish.',
|
|
186
|
+
recovery: 'Omit part to list the whole title, or omit both to list every title; a reserved title and a date before ~2017 publish no tree at all.',
|
|
175
187
|
},
|
|
176
188
|
{
|
|
177
189
|
reason: 'title_required_for_part',
|
|
@@ -274,7 +286,8 @@ export const browseCfrTool = tool('regulations_browse_cfr', {
|
|
|
274
286
|
const reserved = n.reserved ? ' _(reserved)_' : '';
|
|
275
287
|
const cite = n.cfrCite ? ` — \`${n.cfrCite}\` → regulations_get_cfr_section` : '';
|
|
276
288
|
const desc = n.description && n.description !== n.label ? ` — ${n.description}` : '';
|
|
277
|
-
|
|
289
|
+
const appendix = n.appendix ? ` (appendix: \`${n.appendix}\`)` : '';
|
|
290
|
+
lines.push(`- **${n.type}** ${n.identifier}: ${n.label}${desc}${reserved}${cite}${appendix}`);
|
|
278
291
|
}
|
|
279
292
|
}
|
|
280
293
|
if (result.results || result.source) {
|
|
@@ -284,7 +297,12 @@ export const browseCfrTool = tool('regulations_browse_cfr', {
|
|
|
284
297
|
lines.push(`_${result.sourceScope ?? 'Corpus scope unreported.'}_`);
|
|
285
298
|
lines.push('');
|
|
286
299
|
for (const h of result.results ?? []) {
|
|
287
|
-
|
|
300
|
+
const where = [`Title ${h.title}`, `Part ${h.part}`];
|
|
301
|
+
if (h.section)
|
|
302
|
+
where.push(`§ ${h.section}`);
|
|
303
|
+
if (h.appendix)
|
|
304
|
+
where.push(`appendix ${h.appendix}`);
|
|
305
|
+
lines.push(`### ${h.cfrCite} — ${h.heading} [${where.join(', ')}]`);
|
|
288
306
|
lines.push(`_${h.hierarchyPath}_`);
|
|
289
307
|
lines.push(h.excerpt);
|
|
290
308
|
lines.push('');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browse-cfr.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/browse-cfr.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAEL,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,uCAAuC,CAAC;AAE/C,kFAAkF;AAClF,SAAS,YAAY,CAAC,KAAyB,EAAE,IAAwB;IACvE,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACnC,OAAO,IAAI,KAAK,SAAS;QACvB,CAAC,CAAC,uBAAuB,KAAK,EAAE;QAChC,CAAC,CAAC,uBAAuB,KAAK,SAAS,IAAI,EAAE,CAAC;AAClD,CAAC;AAED,gFAAgF;AAChF,SAAS,mBAAmB,CAC1B,KAAkB,EAClB,KAAyB,EACzB,IAAwB;IAExB,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,cAAc,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IACzF,OAAO,wBAAwB,IAAI,GAAG,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"browse-cfr.tool.js","sourceRoot":"","sources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