@blen/fedreg-mcp-server 2.0.0

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.
Files changed (161) hide show
  1. package/CHANGELOG.md +125 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +15 -0
  4. package/README.md +219 -0
  5. package/SECURITY.md +99 -0
  6. package/dist/auth/embedded.d.ts +2 -0
  7. package/dist/auth/embedded.d.ts.map +1 -0
  8. package/dist/auth/embedded.js +17 -0
  9. package/dist/auth/embedded.js.map +1 -0
  10. package/dist/auth/index.d.ts +2 -0
  11. package/dist/auth/index.d.ts.map +1 -0
  12. package/dist/auth/index.js +2 -0
  13. package/dist/auth/index.js.map +1 -0
  14. package/dist/bin.d.ts +3 -0
  15. package/dist/bin.d.ts.map +1 -0
  16. package/dist/bin.js +120 -0
  17. package/dist/bin.js.map +1 -0
  18. package/dist/index.d.ts +11 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +8 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/sandbox/deno.d.ts +13 -0
  23. package/dist/sandbox/deno.d.ts.map +1 -0
  24. package/dist/sandbox/deno.js +203 -0
  25. package/dist/sandbox/deno.js.map +1 -0
  26. package/dist/sandbox/index.d.ts +20 -0
  27. package/dist/sandbox/index.d.ts.map +1 -0
  28. package/dist/sandbox/index.js +46 -0
  29. package/dist/sandbox/index.js.map +1 -0
  30. package/dist/sandbox/isolate.d.ts +7 -0
  31. package/dist/sandbox/isolate.d.ts.map +1 -0
  32. package/dist/sandbox/isolate.js +100 -0
  33. package/dist/sandbox/isolate.js.map +1 -0
  34. package/dist/sandbox/policy.d.ts +7 -0
  35. package/dist/sandbox/policy.d.ts.map +1 -0
  36. package/dist/sandbox/policy.js +70 -0
  37. package/dist/sandbox/policy.js.map +1 -0
  38. package/dist/sandbox/types.d.ts +41 -0
  39. package/dist/sandbox/types.d.ts.map +1 -0
  40. package/dist/sandbox/types.js +2 -0
  41. package/dist/sandbox/types.js.map +1 -0
  42. package/dist/sdk/bindings.d.ts +10 -0
  43. package/dist/sdk/bindings.d.ts.map +1 -0
  44. package/dist/sdk/bindings.js +15 -0
  45. package/dist/sdk/bindings.js.map +1 -0
  46. package/dist/sdk/ecfr-client.d.ts +61 -0
  47. package/dist/sdk/ecfr-client.d.ts.map +1 -0
  48. package/dist/sdk/ecfr-client.js +45 -0
  49. package/dist/sdk/ecfr-client.js.map +1 -0
  50. package/dist/sdk/fr-client.d.ts +81 -0
  51. package/dist/sdk/fr-client.d.ts.map +1 -0
  52. package/dist/sdk/fr-client.js +77 -0
  53. package/dist/sdk/fr-client.js.map +1 -0
  54. package/dist/sdk/regs-client.d.ts +34 -0
  55. package/dist/sdk/regs-client.d.ts.map +1 -0
  56. package/dist/sdk/regs-client.js +44 -0
  57. package/dist/sdk/regs-client.js.map +1 -0
  58. package/dist/sdk/runtime.d.ts +21 -0
  59. package/dist/sdk/runtime.d.ts.map +1 -0
  60. package/dist/sdk/runtime.js +31 -0
  61. package/dist/sdk/runtime.js.map +1 -0
  62. package/dist/sdk/sources/corpus-loader.d.ts +6 -0
  63. package/dist/sdk/sources/corpus-loader.d.ts.map +1 -0
  64. package/dist/sdk/sources/corpus-loader.js +9 -0
  65. package/dist/sdk/sources/corpus-loader.js.map +1 -0
  66. package/dist/sdk/sources/ecfr.d.ts +3 -0
  67. package/dist/sdk/sources/ecfr.d.ts.map +1 -0
  68. package/dist/sdk/sources/ecfr.js +12 -0
  69. package/dist/sdk/sources/ecfr.js.map +1 -0
  70. package/dist/sdk/sources/fr.d.ts +3 -0
  71. package/dist/sdk/sources/fr.d.ts.map +1 -0
  72. package/dist/sdk/sources/fr.js +12 -0
  73. package/dist/sdk/sources/fr.js.map +1 -0
  74. package/dist/sdk/sources/index.d.ts +7 -0
  75. package/dist/sdk/sources/index.d.ts.map +1 -0
  76. package/dist/sdk/sources/index.js +25 -0
  77. package/dist/sdk/sources/index.js.map +1 -0
  78. package/dist/sdk/sources/regs.d.ts +3 -0
  79. package/dist/sdk/sources/regs.d.ts.map +1 -0
  80. package/dist/sdk/sources/regs.js +24 -0
  81. package/dist/sdk/sources/regs.js.map +1 -0
  82. package/dist/sdk/sources/source.d.ts +32 -0
  83. package/dist/sdk/sources/source.d.ts.map +1 -0
  84. package/dist/sdk/sources/source.js +2 -0
  85. package/dist/sdk/sources/source.js.map +1 -0
  86. package/dist/search/bm25.d.ts +25 -0
  87. package/dist/search/bm25.d.ts.map +1 -0
  88. package/dist/search/bm25.js +67 -0
  89. package/dist/search/bm25.js.map +1 -0
  90. package/dist/search/corpus.d.ts +24 -0
  91. package/dist/search/corpus.d.ts.map +1 -0
  92. package/dist/search/corpus.js +23 -0
  93. package/dist/search/corpus.js.map +1 -0
  94. package/dist/server/authz.d.ts +18 -0
  95. package/dist/server/authz.d.ts.map +1 -0
  96. package/dist/server/authz.js +42 -0
  97. package/dist/server/authz.js.map +1 -0
  98. package/dist/server/http.d.ts +21 -0
  99. package/dist/server/http.d.ts.map +1 -0
  100. package/dist/server/http.js +159 -0
  101. package/dist/server/http.js.map +1 -0
  102. package/dist/server/ipRateLimiter.d.ts +11 -0
  103. package/dist/server/ipRateLimiter.d.ts.map +1 -0
  104. package/dist/server/ipRateLimiter.js +27 -0
  105. package/dist/server/ipRateLimiter.js.map +1 -0
  106. package/dist/server/mcpServer.d.ts +15 -0
  107. package/dist/server/mcpServer.d.ts.map +1 -0
  108. package/dist/server/mcpServer.js +67 -0
  109. package/dist/server/mcpServer.js.map +1 -0
  110. package/dist/server/stdio.d.ts +3 -0
  111. package/dist/server/stdio.d.ts.map +1 -0
  112. package/dist/server/stdio.js +16 -0
  113. package/dist/server/stdio.js.map +1 -0
  114. package/dist/server/toolCatalog.d.ts +20 -0
  115. package/dist/server/toolCatalog.d.ts.map +1 -0
  116. package/dist/server/toolCatalog.js +29 -0
  117. package/dist/server/toolCatalog.js.map +1 -0
  118. package/dist/server/wellKnown.d.ts +16 -0
  119. package/dist/server/wellKnown.d.ts.map +1 -0
  120. package/dist/server/wellKnown.js +17 -0
  121. package/dist/server/wellKnown.js.map +1 -0
  122. package/dist/server/zodToJsonSchema.d.ts +7 -0
  123. package/dist/server/zodToJsonSchema.d.ts.map +1 -0
  124. package/dist/server/zodToJsonSchema.js +44 -0
  125. package/dist/server/zodToJsonSchema.js.map +1 -0
  126. package/dist/supervisor/index.d.ts +19 -0
  127. package/dist/supervisor/index.d.ts.map +1 -0
  128. package/dist/supervisor/index.js +22 -0
  129. package/dist/supervisor/index.js.map +1 -0
  130. package/dist/tools/describeSchema.d.ts +35 -0
  131. package/dist/tools/describeSchema.d.ts.map +1 -0
  132. package/dist/tools/describeSchema.js +14 -0
  133. package/dist/tools/describeSchema.js.map +1 -0
  134. package/dist/tools/execute.d.ts +33 -0
  135. package/dist/tools/execute.d.ts.map +1 -0
  136. package/dist/tools/execute.js +28 -0
  137. package/dist/tools/execute.js.map +1 -0
  138. package/dist/tools/searchApi.d.ts +27 -0
  139. package/dist/tools/searchApi.d.ts.map +1 -0
  140. package/dist/tools/searchApi.js +14 -0
  141. package/dist/tools/searchApi.js.map +1 -0
  142. package/dist/util/httpClient.d.ts +46 -0
  143. package/dist/util/httpClient.d.ts.map +1 -0
  144. package/dist/util/httpClient.js +139 -0
  145. package/dist/util/httpClient.js.map +1 -0
  146. package/dist/util/logger.d.ts +7 -0
  147. package/dist/util/logger.d.ts.map +1 -0
  148. package/dist/util/logger.js +19 -0
  149. package/dist/util/logger.js.map +1 -0
  150. package/dist/util/quotas.d.ts +13 -0
  151. package/dist/util/quotas.d.ts.map +1 -0
  152. package/dist/util/quotas.js +29 -0
  153. package/dist/util/quotas.js.map +1 -0
  154. package/dist/util/tokenBucket.d.ts +11 -0
  155. package/dist/util/tokenBucket.d.ts.map +1 -0
  156. package/dist/util/tokenBucket.js +30 -0
  157. package/dist/util/tokenBucket.js.map +1 -0
  158. package/package.json +95 -0
  159. package/schema/ecfr.json +148 -0
  160. package/schema/fr.json +194 -0
  161. package/schema/regs.json +67 -0
@@ -0,0 +1,148 @@
1
+ {
2
+ "endpoints": [
3
+ {
4
+ "id": "ecfr.admin.agencies",
5
+ "kind": "endpoint",
6
+ "binding": "ecfr",
7
+ "signature": "ecfr.admin.agencies()",
8
+ "description": "Get the full agency hierarchy in the eCFR (parent/child relationships, slugs, CFR references).",
9
+ "example": "await ecfr.admin.agencies()"
10
+ },
11
+ {
12
+ "id": "ecfr.titles.list",
13
+ "kind": "endpoint",
14
+ "binding": "ecfr",
15
+ "signature": "ecfr.titles.list()",
16
+ "description": "List all 50 CFR titles with their latest amendment dates and reserved status.",
17
+ "example": "await ecfr.titles.list()"
18
+ },
19
+ {
20
+ "id": "ecfr.structure",
21
+ "kind": "endpoint",
22
+ "binding": "ecfr",
23
+ "signature": "ecfr.structure(date, title)",
24
+ "description": "Return the hierarchical structure (subtitle/chapter/subchapter/part/subpart/section/appendix) of a CFR title on a given date.",
25
+ "example": "await ecfr.structure('2024-01-01', 40)"
26
+ },
27
+ {
28
+ "id": "ecfr.ancestry",
29
+ "kind": "endpoint",
30
+ "binding": "ecfr",
31
+ "signature": "ecfr.ancestry(date, title, query?)",
32
+ "description": "Resolve the ancestors of a specific node (part, section, etc.) within a CFR title.",
33
+ "example": "await ecfr.ancestry('2024-01-01', 40, { part: '60' })"
34
+ },
35
+ {
36
+ "id": "ecfr.versions",
37
+ "kind": "endpoint",
38
+ "binding": "ecfr",
39
+ "signature": "ecfr.versions(title, query?)",
40
+ "description": "List section-level version history for a CFR title.",
41
+ "example": "await ecfr.versions(40, { 'issue_date[gte]': '2023-01-01' })"
42
+ },
43
+ {
44
+ "id": "ecfr.full",
45
+ "kind": "endpoint",
46
+ "binding": "ecfr",
47
+ "signature": "ecfr.full(date, title, query?)",
48
+ "description": "Return the full XML for a CFR title on a given date. Large; filter via query (chapter/part/section) when possible.",
49
+ "example": "await ecfr.full('2024-01-01', 40, { part: '60' })"
50
+ },
51
+ {
52
+ "id": "ecfr.search.results",
53
+ "kind": "endpoint",
54
+ "binding": "ecfr",
55
+ "signature": "ecfr.search.results(params)",
56
+ "description": "Full-text search across the eCFR (Electronic Code of Federal Regulations). Search the consolidated CFR regulations text by query string. Filter by agency, date, hierarchy (title/chapter/part/section).",
57
+ "example": "await ecfr.search.results({ query: 'greenhouse gas', agency_slugs: ['environmental-protection-agency'], per_page: 20 })"
58
+ },
59
+ {
60
+ "id": "ecfr.search.counts_hierarchy",
61
+ "kind": "endpoint",
62
+ "binding": "ecfr",
63
+ "signature": "ecfr.search.counts_hierarchy(params)",
64
+ "description": "Result count grouped by CFR hierarchy node.",
65
+ "example": "await ecfr.search.counts_hierarchy({ query: 'greenhouse gas' })"
66
+ },
67
+ {
68
+ "id": "ecfr.search.counts_titles",
69
+ "kind": "endpoint",
70
+ "binding": "ecfr",
71
+ "signature": "ecfr.search.counts_titles(params)",
72
+ "description": "Result count grouped by CFR title.",
73
+ "example": "await ecfr.search.counts_titles({ query: 'methane' })"
74
+ },
75
+ {
76
+ "id": "ecfr.search.counts_daily",
77
+ "kind": "endpoint",
78
+ "binding": "ecfr",
79
+ "signature": "ecfr.search.counts_daily(params)",
80
+ "description": "Time-series of result counts across the corpus.",
81
+ "example": "await ecfr.search.counts_daily({ query: 'pfas' })"
82
+ },
83
+ {
84
+ "id": "ecfr.search.suggestions",
85
+ "kind": "endpoint",
86
+ "binding": "ecfr",
87
+ "signature": "ecfr.search.suggestions(params)",
88
+ "description": "Autocomplete suggestions for an eCFR search query.",
89
+ "example": "await ecfr.search.suggestions({ query: 'green' })"
90
+ }
91
+ ],
92
+ "fields": [
93
+ {
94
+ "id": "ecfr.section.identifier",
95
+ "kind": "field",
96
+ "binding": "ecfr",
97
+ "description": "Hierarchical identifier for a CFR section, e.g. '40 CFR 60.1'."
98
+ },
99
+ {
100
+ "id": "ecfr.section.label",
101
+ "kind": "field",
102
+ "binding": "ecfr",
103
+ "description": "Human-readable label for a CFR node."
104
+ },
105
+ {
106
+ "id": "ecfr.title.number",
107
+ "kind": "field",
108
+ "binding": "ecfr",
109
+ "description": "CFR title number (1-50)."
110
+ },
111
+ {
112
+ "id": "ecfr.title.latest_amended_on",
113
+ "kind": "field",
114
+ "binding": "ecfr",
115
+ "description": "Most recent amendment date for the title."
116
+ },
117
+ {
118
+ "id": "ecfr.title.latest_issue_date",
119
+ "kind": "field",
120
+ "binding": "ecfr",
121
+ "description": "Latest annual edition issue date for the title."
122
+ },
123
+ {
124
+ "id": "ecfr.search.hits.hierarchy.title",
125
+ "kind": "field",
126
+ "binding": "ecfr",
127
+ "description": "CFR title containing a search hit."
128
+ },
129
+ {
130
+ "id": "ecfr.search.hits.hierarchy.part",
131
+ "kind": "field",
132
+ "binding": "ecfr",
133
+ "description": "CFR part containing a search hit."
134
+ },
135
+ {
136
+ "id": "ecfr.search.hits.hierarchy.section",
137
+ "kind": "field",
138
+ "binding": "ecfr",
139
+ "description": "CFR section containing a search hit."
140
+ },
141
+ {
142
+ "id": "ecfr.search.hits.score",
143
+ "kind": "field",
144
+ "binding": "ecfr",
145
+ "description": "Relevance score for a search hit."
146
+ }
147
+ ]
148
+ }
package/schema/fr.json ADDED
@@ -0,0 +1,194 @@
1
+ {
2
+ "endpoints": [
3
+ {
4
+ "id": "fr.documents.search",
5
+ "kind": "endpoint",
6
+ "binding": "fr",
7
+ "signature": "fr.documents.search(params)",
8
+ "description": "Search Federal Register documents published since 1994. Filter by agency, publication date, type (RULE, PRORULE, NOTICE, PRESDOCU), topic, CFR title/part, docket id, significance.",
9
+ "example": "await fr.documents.search({ conditions: { term: 'methane', agencies: ['environmental-protection-agency'], publication_date: { gte: '2024-01-01' } }, per_page: 50, order: 'newest' })"
10
+ },
11
+ {
12
+ "id": "fr.documents.get",
13
+ "kind": "endpoint",
14
+ "binding": "fr",
15
+ "signature": "fr.documents.get(documentNumber, fields?)",
16
+ "description": "Fetch a single Federal Register document by its FR document number.",
17
+ "example": "await fr.documents.get('2024-12345')"
18
+ },
19
+ {
20
+ "id": "fr.documents.getMany",
21
+ "kind": "endpoint",
22
+ "binding": "fr",
23
+ "signature": "fr.documents.getMany(documentNumbers, fields?)",
24
+ "description": "Fetch multiple Federal Register documents in one call.",
25
+ "example": "await fr.documents.getMany(['2024-12345', '2024-12346'])"
26
+ },
27
+ {
28
+ "id": "fr.documents.facets",
29
+ "kind": "endpoint",
30
+ "binding": "fr",
31
+ "signature": "fr.documents.facets({ facet, conditions? })",
32
+ "description": "Aggregate document counts by daily/weekly/monthly/quarterly/yearly buckets, or by agency, topic, section, subject, type.",
33
+ "example": "await fr.documents.facets({ facet: 'monthly', conditions: { agencies: ['nuclear-regulatory-commission'] } })"
34
+ },
35
+ {
36
+ "id": "fr.publicInspection.current",
37
+ "kind": "endpoint",
38
+ "binding": "fr",
39
+ "signature": "fr.publicInspection.current(fields?)",
40
+ "description": "List documents currently on public inspection (not yet officially published).",
41
+ "example": "await fr.publicInspection.current()"
42
+ },
43
+ {
44
+ "id": "fr.publicInspection.search",
45
+ "kind": "endpoint",
46
+ "binding": "fr",
47
+ "signature": "fr.publicInspection.search(params)",
48
+ "description": "Search public inspection documents by agency, type, special filing, docket.",
49
+ "example": "await fr.publicInspection.search({ conditions: { agencies: ['federal-aviation-administration'] } })"
50
+ },
51
+ {
52
+ "id": "fr.publicInspection.get",
53
+ "kind": "endpoint",
54
+ "binding": "fr",
55
+ "signature": "fr.publicInspection.get(documentNumber, fields?)",
56
+ "description": "Fetch one public inspection document by document number.",
57
+ "example": "await fr.publicInspection.get('2024-99999')"
58
+ },
59
+ {
60
+ "id": "fr.agencies.list",
61
+ "kind": "endpoint",
62
+ "binding": "fr",
63
+ "signature": "fr.agencies.list()",
64
+ "description": "List every agency that publishes in the Federal Register with slug, short name, parent.",
65
+ "example": "await fr.agencies.list()"
66
+ },
67
+ {
68
+ "id": "fr.agencies.get",
69
+ "kind": "endpoint",
70
+ "binding": "fr",
71
+ "signature": "fr.agencies.get(slug)",
72
+ "description": "Fetch a single agency by slug (e.g. 'environmental-protection-agency').",
73
+ "example": "await fr.agencies.get('environmental-protection-agency')"
74
+ },
75
+ {
76
+ "id": "fr.issues.get",
77
+ "kind": "endpoint",
78
+ "binding": "fr",
79
+ "signature": "fr.issues.get(publicationDate)",
80
+ "description": "Fetch the table of contents for a specific Federal Register issue.",
81
+ "example": "await fr.issues.get('2024-03-15')"
82
+ },
83
+ {
84
+ "id": "fr.suggestedSearches.list",
85
+ "kind": "endpoint",
86
+ "binding": "fr",
87
+ "signature": "fr.suggestedSearches.list(sections?)",
88
+ "description": "List curated FederalRegister.gov searches by section.",
89
+ "example": "await fr.suggestedSearches.list('environment')"
90
+ },
91
+ {
92
+ "id": "fr.suggestedSearches.get",
93
+ "kind": "endpoint",
94
+ "binding": "fr",
95
+ "signature": "fr.suggestedSearches.get(section)",
96
+ "description": "Get curated searches for one section.",
97
+ "example": "await fr.suggestedSearches.get('environment')"
98
+ },
99
+ {
100
+ "id": "fr.images.get",
101
+ "kind": "endpoint",
102
+ "binding": "fr",
103
+ "signature": "fr.images.get(identifier)",
104
+ "description": "Fetch metadata for a Federal Register image (graphics, signatures).",
105
+ "example": "await fr.images.get('ER15MR24.001')"
106
+ }
107
+ ],
108
+ "fields": [
109
+ {
110
+ "id": "fr.document.document_number",
111
+ "kind": "field",
112
+ "binding": "fr",
113
+ "description": "Unique Federal Register document number (e.g. '2024-12345'). Primary key for get/getMany."
114
+ },
115
+ {
116
+ "id": "fr.document.title",
117
+ "kind": "field",
118
+ "binding": "fr",
119
+ "description": "Document title as it appears in the Federal Register."
120
+ },
121
+ {
122
+ "id": "fr.document.abstract",
123
+ "kind": "field",
124
+ "binding": "fr",
125
+ "description": "Plain-text abstract of the document."
126
+ },
127
+ {
128
+ "id": "fr.document.publication_date",
129
+ "kind": "field",
130
+ "binding": "fr",
131
+ "description": "ISO date the document was published. Filter via conditions.publication_date.{is,gte,lte,year}."
132
+ },
133
+ {
134
+ "id": "fr.document.effective_date",
135
+ "kind": "field",
136
+ "binding": "fr",
137
+ "description": "Effective date for rules. Filter via conditions.effective_date."
138
+ },
139
+ {
140
+ "id": "fr.document.type",
141
+ "kind": "field",
142
+ "binding": "fr",
143
+ "description": "Document type: 'Rule' (RULE), 'Proposed Rule' (PRORULE), 'Notice' (NOTICE), 'Presidential Document' (PRESDOCU)."
144
+ },
145
+ {
146
+ "id": "fr.document.agencies",
147
+ "kind": "field",
148
+ "binding": "fr",
149
+ "description": "Issuing agencies. Filter via conditions.agencies[] using agency slug."
150
+ },
151
+ {
152
+ "id": "fr.document.docket_ids",
153
+ "kind": "field",
154
+ "binding": "fr",
155
+ "description": "Agency docket identifiers associated with the document."
156
+ },
157
+ {
158
+ "id": "fr.document.significant",
159
+ "kind": "field",
160
+ "binding": "fr",
161
+ "description": "1 if the document is flagged as Significant under EO 12866."
162
+ },
163
+ {
164
+ "id": "fr.document.cfr_references",
165
+ "kind": "field",
166
+ "binding": "fr",
167
+ "description": "List of CFR title/part references touched by the document."
168
+ },
169
+ {
170
+ "id": "fr.document.executive_order_number",
171
+ "kind": "field",
172
+ "binding": "fr",
173
+ "description": "Executive order number for presidential documents."
174
+ },
175
+ {
176
+ "id": "fr.document.html_url",
177
+ "kind": "field",
178
+ "binding": "fr",
179
+ "description": "Canonical federalregister.gov URL for the document."
180
+ },
181
+ {
182
+ "id": "fr.document.pdf_url",
183
+ "kind": "field",
184
+ "binding": "fr",
185
+ "description": "URL to the official PDF on govinfo.gov."
186
+ },
187
+ {
188
+ "id": "fr.document.body_html_url",
189
+ "kind": "field",
190
+ "binding": "fr",
191
+ "description": "URL to the rendered body HTML of the document."
192
+ }
193
+ ]
194
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "endpoints": [
3
+ {
4
+ "id": "regs.documents.search",
5
+ "kind": "endpoint",
6
+ "binding": "regs",
7
+ "signature": "regs.documents.search(params)",
8
+ "description": "Search regulations.gov documents (rules, proposed rules, notices, supporting & related material). The regulations.gov view adds docket linkage, live comment-period status (openForComment, commentEndDate), and the objectId needed to fetch comments. For canonical Federal Register rule text/metadata since 1994, prefer fr.documents; use this when you need comments or docket context. Filters: filter[searchTerm], filter[agencyId], filter[docketId], filter[documentType], filter[postedDate][ge|le], filter[lastModifiedDate][ge|le]. JSON:API response (data/included/meta.totalElements).",
9
+ "example": "await regs.documents.search({ filter: { searchTerm: 'methane', postedDate: { ge: '2024-01-01' } }, sort: '-postedDate', page: { size: 250 } })"
10
+ },
11
+ {
12
+ "id": "regs.documents.get",
13
+ "kind": "endpoint",
14
+ "binding": "regs",
15
+ "signature": "regs.documents.get(documentId, { include?: 'attachments' })",
16
+ "description": "Fetch one regulations.gov document by its documentId. Read objectId from data.attributes to then query comments via regs.comments.search({ filter: { commentOnId } }).",
17
+ "example": "await regs.documents.get('EPA-HQ-OAR-2021-0317-0001', { include: 'attachments' })"
18
+ },
19
+ {
20
+ "id": "regs.comments.search",
21
+ "kind": "endpoint",
22
+ "binding": "regs",
23
+ "signature": "regs.comments.search(params)",
24
+ "description": "Search public comments submitted to regulations.gov. The unique value over Federal Register / eCFR. Filter by filter[commentOnId] (the document's objectId), filter[searchTerm], filter[agencyId], filter[postedDate][ge|le], filter[lastModifiedDate][ge|le]. Results cap at ~5000 per query (page[size] max 250); page past it with the lastModifiedDate cursor (sort by lastModifiedDate, then re-query with filter[lastModifiedDate][ge] = last seen value).",
25
+ "example": "await regs.comments.search({ filter: { commentOnId: '0900006481b...' }, sort: 'lastModifiedDate', page: { size: 250 } })"
26
+ },
27
+ {
28
+ "id": "regs.comments.get",
29
+ "kind": "endpoint",
30
+ "binding": "regs",
31
+ "signature": "regs.comments.get(commentId, { include?: 'attachments' })",
32
+ "description": "Fetch one public comment (full text + optional attachments). Some submitter fields are never public (email, phone, address).",
33
+ "example": "await regs.comments.get('EPA-HQ-OAR-2021-0317-0123', { include: 'attachments' })"
34
+ },
35
+ {
36
+ "id": "regs.dockets.search",
37
+ "kind": "endpoint",
38
+ "binding": "regs",
39
+ "signature": "regs.dockets.search(params)",
40
+ "description": "Search regulations.gov dockets (the folder grouping a rulemaking's documents and comments). Filter by filter[searchTerm], filter[agencyId] (comma-separated), filter[lastModifiedDate][ge|le]. Sort by title or -title.",
41
+ "example": "await regs.dockets.search({ filter: { agencyId: 'EPA', searchTerm: 'greenhouse gas' } })"
42
+ },
43
+ {
44
+ "id": "regs.dockets.get",
45
+ "kind": "endpoint",
46
+ "binding": "regs",
47
+ "signature": "regs.dockets.get(docketId)",
48
+ "description": "Fetch one docket by its docketId, including its comment-period metadata and counts.",
49
+ "example": "await regs.dockets.get('EPA-HQ-OAR-2021-0317')"
50
+ },
51
+ {
52
+ "id": "regs.recipes.comments-on-a-rule",
53
+ "kind": "endpoint",
54
+ "binding": "regs",
55
+ "signature": "(cross-source recipe)",
56
+ "description": "Recipe: find public comments on a specific Federal Register rule. Use fr.documents.search to locate the rule and read its document number, then regs.documents.search with filter[searchTerm] = that document number (frDocNum is a returned attribute, NOT a filter) to get the regulations.gov document and its objectId, then regs.comments.search filtered by commentOnId = that objectId.",
57
+ "example": "const fr1 = await fr.documents.search({ conditions: { term: 'methane', type: ['RULE'] }, per_page: 1, order: 'newest' }); const docNum = fr1.results[0].document_number; const rd = await regs.documents.search({ filter: { searchTerm: docNum } }); const objectId = rd.data[0].attributes.objectId; const comments = await regs.comments.search({ filter: { commentOnId: objectId }, page: { size: 250 } });"
58
+ }
59
+ ],
60
+ "fields": [
61
+ { "id": "regs.documents.objectId", "kind": "field", "binding": "regs", "description": "Internal regulations.gov id of a document; pass as filter[commentOnId] to regs.comments.search to fetch its comments." },
62
+ { "id": "regs.documents.frDocNum", "kind": "field", "binding": "regs", "description": "Federal Register document number; a RETURNED attribute, not a filterable field. To find a regs document for a known FR document number, use filter[searchTerm] = that number. Bridges a regs document to fr.documents." },
63
+ { "id": "regs.documents.commentEndDate", "kind": "field", "binding": "regs", "description": "When the public comment period closes (regulations.gov view)." },
64
+ { "id": "regs.documents.openForComment", "kind": "field", "binding": "regs", "description": "Boolean: whether the document is currently open for public comment." },
65
+ { "id": "regs.meta.totalElements", "kind": "field", "binding": "regs", "description": "Total matching records for a search; read from the JSON:API meta object to drive pagination." }
66
+ ]
67
+ }