get_osha_enforcement
Returns OSHA workplace-safety enforcement records from the Department of Labor's enforcement data: inspection cases (who was inspected, where, why, when) with optional violation citations attached (standard cited, violation type, penalties, abatement dates). Use this when the user asks about: a company's workplace-safety record, OSHA penalties or citations, fatality/catastrophe investigations, inspection activity by state or industry (NAICS), or contractor safety research. Result rows are INSPECTIONS. Pass include_violations=true to attach each inspection's citations under a violations array (or pass activity_nr for a direct lookup, which always includes them). min_penalty keeps only inspections with at least one violation whose initial or current penalty meets the threshold (implies include_violations). insp_type codes (DOL's own legend): A=Accident, B=Complaint, C=Referral, D=Monitoring, E=Variance, F=FollowUp, G=Unprog Rel, H=Planned, I=Prog Related, J=Unprog Other, K=Prog Other, L=Other-L, M=Fat/Cat (fatality/catastrophe), N=Unprog Emph. Each record carries insp_type_label with the decoded value. Violation viol_type codes: S=Serious, W=Willful, R=Repeat, O=Other, U=Unclassified. Violations carry delete_flag='X' when the source later deleted the citation — rows are kept with the flag, never dropped. Filter combinations note: server-side indexes support ONE of state / naics_code combined with the open_date sort + since/until. Other filters (establishment_name substring, insp_type, state+naics together, min_penalty) post-filter client-side over a widened fetch window. sort_by=case_mod_date is the 'recently updated cases' firehose and cannot be combined with state / naics_code / since / until. Pure-publisher posture: DOL's enforcement rows as published — codes kept verbatim (with the source's own legend decoded alongside), no safety scoring. Each record's source_url links to the osha.gov establishment inspection-detail page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum inspections to return. Default 50, max 500. | |
| since | No | Inspection open_date lower bound (YYYY-MM-DD inclusive). | |
| state | No | Two-letter site state (e.g., 'TX', 'CA'). | |
| until | No | Inspection open_date upper bound (YYYY-MM-DD inclusive). | |
| sort_by | No | Sort key. Default: open_date. case_mod_date = most recently UPDATED cases (cannot combine with state/naics_code/since/until). | |
| insp_type | No | One-letter inspection-type code (e.g., 'M' Fat/Cat, 'B' Complaint, 'H' Planned — full legend in the tool description). | |
| naics_code | No | Exact NAICS industry code of the inspected site (e.g., '238160' roofing contractors). Note: '000000' on many pre-NAICS-era records. | |
| sort_order | No | Default: desc (most recent first). | |
| activity_nr | No | Direct lookup by OSHA inspection activity number (e.g., '317465899'). Returns the inspection with its violations attached. Fastest path. | |
| min_penalty | No | Keep only inspections with at least one violation whose initial or current penalty is >= this amount (dollars). Implies include_violations=true. | |
| establishment_name | No | Case-insensitive substring against the inspected establishment's name (e.g., 'amazon', 'dollar general'). Client-side filter. | |
| include_violations | No | When true, attaches each returned inspection's violation citations under a `violations` array (standard, type, penalties, abatement/contest dates). Default false. |