data-analyst-mcp 0.7.0 → 0.9.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 (83) hide show
  1. package/README.md +2 -2
  2. package/dist/adapters/rma.d.ts +10 -0
  3. package/dist/adapters/rma.js +40 -0
  4. package/dist/adapters/rma.js.map +1 -0
  5. package/dist/analysis/combine.js +3 -2
  6. package/dist/analysis/combine.js.map +1 -1
  7. package/dist/analysis/compute.d.ts +26 -5
  8. package/dist/analysis/compute.js +402 -159
  9. package/dist/analysis/compute.js.map +1 -1
  10. package/dist/analysis/expr.js +2 -1
  11. package/dist/analysis/expr.js.map +1 -1
  12. package/dist/analysis/handoff.d.ts +1 -1
  13. package/dist/analysis/handoff.js +44 -3
  14. package/dist/analysis/handoff.js.map +1 -1
  15. package/dist/analysis/table.d.ts +7 -0
  16. package/dist/analysis/table.js +30 -1
  17. package/dist/analysis/table.js.map +1 -1
  18. package/dist/analysis/tools.d.ts +10 -7
  19. package/dist/analysis/tools.js +32 -43
  20. package/dist/analysis/tools.js.map +1 -1
  21. package/dist/core/compact.d.ts +15 -0
  22. package/dist/core/compact.js +98 -0
  23. package/dist/core/compact.js.map +1 -0
  24. package/dist/core/generic-rest.js +2 -1
  25. package/dist/core/generic-rest.js.map +1 -1
  26. package/dist/core/package.d.ts +8 -0
  27. package/dist/core/package.js +30 -1
  28. package/dist/core/package.js.map +1 -1
  29. package/dist/core/packs.d.ts +4 -2
  30. package/dist/core/sections.d.ts +21 -0
  31. package/dist/core/sections.js +53 -0
  32. package/dist/core/sections.js.map +1 -0
  33. package/dist/core/tabular.d.ts +2 -0
  34. package/dist/core/tabular.js +14 -3
  35. package/dist/core/tabular.js.map +1 -1
  36. package/dist/deep/opm.js +10 -2
  37. package/dist/deep/opm.js.map +1 -1
  38. package/dist/deep/treasury.js +7 -3
  39. package/dist/deep/treasury.js.map +1 -1
  40. package/dist/envelope.js +1 -1
  41. package/dist/envelope.js.map +1 -1
  42. package/dist/index.d.ts +57 -4
  43. package/dist/report/audit_report.js +3 -0
  44. package/dist/report/audit_report.js.map +1 -1
  45. package/dist/report/build_report.d.ts +18 -0
  46. package/dist/report/build_report.js +52 -7
  47. package/dist/report/build_report.js.map +1 -1
  48. package/dist/report/tools.d.ts +26 -1
  49. package/dist/report/tools.js +74 -17
  50. package/dist/report/tools.js.map +1 -1
  51. package/dist/server.d.ts +1 -1
  52. package/dist/server.js +52 -43
  53. package/dist/server.js.map +1 -1
  54. package/dist/session.d.ts +2 -0
  55. package/dist/session.js +2 -0
  56. package/dist/session.js.map +1 -1
  57. package/dist/tools.d.ts +98 -6
  58. package/dist/tools.js +154 -17
  59. package/dist/tools.js.map +1 -1
  60. package/guide/WORKFLOW.md +7 -4
  61. package/guide/references/compute.md +51 -0
  62. package/guide/references/report_quick.md +60 -0
  63. package/guide/references/routing.md +2 -0
  64. package/package.json +1 -1
  65. package/packs/cbp/source.md +1 -1
  66. package/packs/cdc-wonder/source.md +1 -1
  67. package/packs/census/docs/microdata.md +77 -0
  68. package/packs/census/docs/timeseries.md +71 -0
  69. package/packs/census/source.md +10 -142
  70. package/packs/congress/docs/nominations_crs.md +26 -0
  71. package/packs/congress/docs/votes.md +30 -0
  72. package/packs/congress/source.md +4 -48
  73. package/packs/govinfo/docs/collections.md +88 -0
  74. package/packs/govinfo/source.md +6 -86
  75. package/packs/irs-soi/docs/eo.md +15 -0
  76. package/packs/irs-soi/docs/tables.md +50 -0
  77. package/packs/irs-soi/source.md +6 -57
  78. package/packs/port.json +5 -0
  79. package/packs/rma/endpoints.json +44 -0
  80. package/packs/rma/policy.json +94 -0
  81. package/packs/rma/source.md +78 -0
  82. package/packs/sba/source.md +1 -1
  83. package/packs/uscourts/source.md +1 -1
@@ -0,0 +1,78 @@
1
+ # USDA RMA federal crop insurance: Summary of Business (liability, premium, subsidy, indemnity) and reinsurance results
2
+ Depth: standard. Key: none. The Risk Management Agency's public data files (pubfs-rma.fpac.usda.gov), which
3
+ run the Federal Crop Insurance Corporation's program:
4
+ - the Summary of Business by commodity year, state, county, crop, insurance plan, coverage category, delivery
5
+ type and coverage level: policies, units, insured quantity, liability, total premium, premium subsidy,
6
+ indemnity and loss ratio (1989 on);
7
+ - the Standard Reinsurance Agreement results by reinsurance year and fund, national or by state: gross and
8
+ retained liability, premium and indemnity, and the insurance companies' net underwriting gain or loss
9
+ (2014 on).
10
+
11
+ ## When to use
12
+ - Crop insurance cost inputs: premium subsidies (the federal share of premium) by state, crop, plan or coverage
13
+ level; indemnities and loss ratios over time; liability and insured acres; the effect of a change in subsidy
14
+ rates by coverage level; companies' underwriting gains, a program cost beside subsidies.
15
+ - Not here: crop insurance outlays by fiscal year as the budget records them (treasury MTS, omb; USDA's
16
+ budget account is the Federal Crop Insurance Corporation Fund); crop production, prices and acreage on all
17
+ farms (usda-nass, usda-outlook); farm commodity program payments.
18
+
19
+ ## Endpoints
20
+ | Endpoint | Rows | Filters |
21
+ |---|---|---|
22
+ | `coverage` (`year`, a commodity year; 3 to 30 MB a year, 150,000 rows recently) | one per year, state, county, crop, plan, coverage category, delivery type and coverage level | `state` (abbreviation or FIPS), `county` (FIPS), `commodity` (name or code), `plan` (abbreviation or code), `coverage_category`, `delivery_type` |
23
+ | `reinsurance` (`year`, a reinsurance year; `level` National or State) | one per fund (and state), plus the published Total row | `state` |
24
+
25
+ Columns of `coverage`, as the layout document names them: Commodity Year, Location State Code, Location State
26
+ Abbreviation, Location County Code, Location County Name, Commodity Code, Commodity Name, Insurance Plan Code,
27
+ Insurance Plan Name Abbreviation, Coverage Category, Delivery Type, Coverage Level, Policies Sold Count,
28
+ Policies Earning Premium Count, Policies Indemnified Count, Units Earning Premium Count, Units Indemnified Count,
29
+ Quantity Type, Net Reported Quantity, Endorsed/Companion Acres, Liability Amount, Total Premium Amount, Subsidy
30
+ Amount, State/Private Subsidy, Additional Subsidy, EFA Premium Discount, Indemnity Amount, Loss Ratio.
31
+
32
+ ## Spec examples
33
+ ```json
34
+ {"description": "Iowa corn crop insurance by plan and coverage level, crop year 2024",
35
+ "requests": [{"name": "ia_corn_2024", "endpoint": "coverage", "params": {"year": "2024", "state": "IA", "commodity": "Corn"}}]}
36
+ ```
37
+ ```json
38
+ {"description": "Standard Reinsurance Agreement results by fund, national, reinsurance year 2024",
39
+ "requests": [{"name": "sra_2024", "endpoint": "reinsurance", "params": {"year": "2024", "level": "National"}}]}
40
+ ```
41
+
42
+ ## Data format and traps
43
+ - Dollars, as published (whole dollars in `coverage`; reinsurance sheets carry decimals). Loss Ratio is
44
+ indemnity / total premium, as a decimal (`.33`); recompute it from summed dollars, never average it.
45
+ - Total Premium Amount is the full premium. The federal premium subsidy is Subsidy Amount. The farmer-paid
46
+ premium is total premium less Subsidy Amount, State/Private Subsidy, Additional Subsidy (the 2021-2022
47
+ Pandemic Cover Crop Program) and EFA Premium Discount. The subsidy rate (subsidy / premium) is set by law for
48
+ each coverage level and unit structure; read it from the data, never assume it.
49
+ - The Summary of Business holds premium, subsidy and indemnity only. The program's full cost also includes
50
+ delivery expense (A&O) reimbursements to companies and their underwriting gains under the reinsurance
51
+ agreement (`reinsurance`: Net Gain/Loss, positive is a company gain), which are not in `coverage`.
52
+ - Years: commodity (crop) year in `coverage`; reinsurance year (July to June) in `reinsurance`. Neither is the
53
+ federal fiscal year. Open years (the current and next crop years) are updated every week and late years still
54
+ change as claims settle; give the file date (the zip's member date) with the numbers.
55
+ - Quantity Type is the unit of Net Reported Quantity (Acres, Colonies, Trees, Vines, NotReported...): never add
56
+ quantities across types. Insured acres are counted once per plan line, so acres across crops add, but the
57
+ Endorsed/Companion Acres of an SCO, STAX or ECO endorsement are on top of the underlying policy's acres.
58
+ - Indemnities can be negative (adjustments: 25 rows in the 2024 file of 2026-11-11). Sum them with the rest.
59
+ - Policy and unit counts are not available for CLIP and some area plans (zeros), so counts do not add across
60
+ plans to a farm count.
61
+ - County 999 (All Other Counties) and commodity 9999 (All Other Crops) are published groupings; keep them in
62
+ totals.
63
+ - `reinsurance` has a Total row (sum of the funds; State: all states): drop it before summing. Retained figures
64
+ include the 6.5 percent net book quota share (the sheet's footnote). Fund A is assigned (mostly ceded to
65
+ FCIC), fund C commercial.
66
+ - Older years and other files on the server: by type, practice and unit structure (sobtpu, 1999 on), cause of
67
+ loss by month (colsom), livestock (LRP, LGM, DRP). Not read here.
68
+
69
+ ## Access
70
+ No key. `fetch` reads pubfs-rma.fpac.usda.gov/pub/Web_Data_Files (verified 2026-11-11: sobcov zips up to
71
+ 3 MB compressed, 28 MB of text; reinsurance .xls 30 to 50 KB) and filters the rows here. Manual: the same
72
+ folders in a browser, then `ingest` the zip or workbook. The layout documents sit beside the files
73
+ (SOB_State_County_Crop_with_Coverage_Level_1989_Forward.pdf).
74
+
75
+ ## Citation and terms
76
+ "U.S. Department of Agriculture, Risk Management Agency, Summary of Business (State/County/Crop with Coverage
77
+ Level), sobcov_<year>.zip, pubfs-rma.fpac.usda.gov, retrieved <date>." For reinsurance: "..., Standard
78
+ Reinsurance Agreement Report, <year> <National|State> ...". Public domain (17 U.S.C. 105).
@@ -20,7 +20,7 @@ Files of 2026-11-07 (as of September 30, 2026): `uploaded_resources/FOIA_7a_FY19
20
20
  `..._FY2000_FY2009_...`, `..._FY2010_FY2019_...`, `..._FY2020_Present_...`, `uploaded_resources/FOIA_504_FY1991_FY2009_asof_260930`,
21
21
  `..._504_FY2010_Present_...`. The as-of part changes each quarter: run `list_files` first.
22
22
 
23
- ## Spec example
23
+ ## Spec examples
24
24
  ```json
25
25
  {"description": "504 loans in Vermont approved FY2024-2025",
26
26
  "requests": [{"name": "files", "endpoint": "list_files", "params": {"search": "7(a) & 504 FOIA"}},
@@ -24,7 +24,7 @@ The file name is on the table's entry in https://www.uscourts.gov/statistics-rep
24
24
  June 30, 2026.
25
25
  - The date part is not zero-padded the same way in every series: copy it.
26
26
 
27
- ## Spec example
27
+ ## Spec examples
28
28
  ```json
29
29
  {"description": "Bankruptcy filings by chapter and district, 12 months to September 30, 2026 (table F-2)",
30
30
  "requests": [{"name": "f2", "endpoint": "table",