Skip to main content
Glama

Msha Violation Counts

msha_violation_counts
Read-onlyIdempotent

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.

Input Schema

NameRequiredDescriptionDefault
yearNoSingle calendar year to count, e.g. 2025.
mine_idNoMSHA Mine ID, e.g. "4601437". Preferred over mine_name — unambiguous.
year_toNoLast calendar year of a range (inclusive). Use together with year_from instead of year.
mine_nameNoMine, 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.
year_fromNoFirst calendar year of a range (inclusive). Use together with year_to instead of year.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly/idempotent/non-destructive, but the description adds substantive behavior: only the most recent 5 calendar years are loaded, out-of-window years return 'not loaded' rather than a silent zero, the coverage field reports the exact window, and the counting basis is MSHA's CAL_YR. It also discloses the data source and weekly refresh cadence.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core purpose and the 'ONE call, not a listing' distinction are front-loaded, and the following sentences each carry distinct operational facts. It is dense and slightly long, but nearly every clause adds information rather than restating the name or schema.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only counting tool with no output schema, the description still conveys the return shape (total plus breakdowns by recipient type and S&S status, plus a coverage field) and the failure mode for uncovered years. An agent has enough to call it correctly and interpret the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description adds real meaning on top by explaining the year vs. year_from/year_to alternative, that mine_id is preferred over mine_name because it is unambiguous, and that the name path only succeeds on an exact single-mine match. It stops short of documenting edge cases such as conflicting year and range parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Count MSHA violations issued at one mine within a calendar year or year range') and immediately contrasts with a listing approach. It explicitly names the sibling msha_mine_detail and what distinguishes this tool from it, so an agent can select without opening schemas.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit routing rule: use this instead of msha_mine_detail when the question is 'how many,' with the reason (detail returns only violations_limit rows, default 20, max 100, no true count). It also directs the agent to msha_mine_search to obtain a Mine ID and explains the fallback when a name resolves to multiple mines.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.