msha_violation_counts

Pack: msha-mines · Connect: https://pipeworx.io/mcp (see Connect below for a single-pack URL)

No MCP client? Call it directly: GET https://gateway.pipeworx.io/v1/tools/msha_violation_counts for the schema, then POST the same URL with its arguments for the data.

Count MSHA violations issued at one mine within a calendar year or year range — in ONE call, not a listing. Returns the TOTAL plus a breakdown by who it was issued to (Operator vs Contractor vs Agent vs Miner) and by significant-and-substantial (S&S) status. Use this instead of msha_mine_detail when the question is “how many” — msha_mine_detail only returns its most recent violations_limit rows (default 20, max 100) and has no true count. Counted by the calendar year of each violation’s own issue date (VIOLATION_ISSUE_DT, via MSHA’s own CAL_YR field). Only the most recent 5 calendar years are loaded (the response’s coverage field says exactly which); a year outside that window comes back flagged as “not loaded,” never as a silent zero. Takes a known MSHA Mine ID (use msha_mine_search to find one) or a mine/operator/controller name — the name path only works when it resolves to exactly one mine; otherwise it lists the candidates so you can retry with a mine_id. Sourced from MSHA’s own bulk mine-records files (public domain), refreshed weekly. Keyless.

Parameters

NameTypeRequiredDescription
mine_idstringnoMSHA Mine ID, e.g. “4601437”. Preferred over mine_name — unambiguous.
mine_namestringnoMine, operator, or controller name to resolve to a Mine ID — used only when mine_id is omitted, and only works if it matches exactly one mine.
yearnumbernoSingle calendar year to count, e.g. 2025.
year_fromnumbernoFirst calendar year of a range (inclusive). Use together with year_to instead of year.
year_tonumbernoLast calendar year of a range (inclusive). Use together with year_from instead of year.

Example call

Arguments

{
  "mine_id": "4601437",
  "year": 2025
}

curl

curl -X POST https://gateway.pipeworx.io/msha-mines/mcp \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"msha_violation_counts","arguments":{"mine_id":"4601437","year":2025}}}'

TypeScript (@pipeworx/sdk)

import { Pipeworx } from '@pipeworx/sdk';
const pipeworx = new Pipeworx();

const result = await pipeworx.call('msha_violation_counts', {
  "mine_id": "4601437",
  "year": 2025
});

Connect

Add this to your MCP client config — every tool in the catalog, including this one — or use one-click install buttons:

{
  "mcpServers": {
    "pipeworx": {
      "url": "https://pipeworx.io/mcp"
    }
  }
}
Connect to just the msha-mines pack
{
  "mcpServers": {
    "msha-mines": {
      "url": "https://gateway.pipeworx.io/msha-mines/mcp"
    }
  }
}

See Getting Started for client-specific install steps.

Regenerated from source · build October 16, 2026