Recipe: Environmental risk

The task

You want a facility or company’s environmental risk profile: EPA enforcement history, greenhouse-gas emissions, toxic releases, local air quality, and pending federal rules that would affect its industry.

Tools used: echo_facility_search, ghg_facility_emissions, tri_facility_releases, air_quality_near (OpenAQ), federal_register_search_documents.

Calls: 4-5.

Copy-paste prompt

Build an environmental risk profile for <facility name>, <state> using Pipeworx: EPA enforcement
actions and permit status, greenhouse-gas emissions, Toxic Release Inventory releases, nearby air
quality, and any pending federal rules relevant to its industry. Roll up to one risk tier
(Low/Moderate/High/Severe) and tell me plainly if any leg came back empty rather than treating
silence as a clean record.

What a good answer looks like

echo_facility_search({ facility_name: "%EXXONMOBIL BAYTOWN%", state: "TX" })

returns (live call, 2026-08-06 — one result trimmed):

{
  "total_count": 7,
  "facilities": [
    {
      "registry_id": "110000463178",
      "name": "BAYTOWN OLEFINS PLANT",
      "city": "BAYTOWN", "state": "TX", "zip": "77520",
      "latitude": 29.73934, "longitude": -95.022404,
      "caa_status": "Violation Addressed; EPA Has Lead Enforcement",
      "cwa_status": "No Violation Identified",
      "quarters_in_noncompliance": 12,
      "formal_action_count": 4,
      "total_penalties": 2204913
    }
  ]
}

A trustworthy answer has:

  • a registry_id — EPA’s stable cross-program facility ID, worth keeping even though (see below) it doesn’t carry across to the other EPA datasets.
  • non-null enforcement counters (formal_action_count, total_penalties, quarters_in_noncompliance) rather than a facility record with no compliance data attached.
  • latitude/longitude on the record, which you feed straight into air_quality_near without re-geocoding.

A plausible-sounding failure looks like a clean, well-formed zero — from the same real facility, in a different EPA dataset. This is live, not hypothetical. The plant above is a real, large emitter — but ask its greenhouse-gas data under the name that just worked:

ghg_facility_emissions({ facility_name: "Baytown Olefins", state: "TX" })
// → { "state": "TX", "year": 2023, "count": 0, "facilities": [] }

Zero facilities. Read at face value, that says “this plant isn’t a notable GHG emitter.” It is one of the largest in Texas — 94.8 million metric tons CO2e in 2023 — reporting to the GHGRP under a completely different name:

ghg_facility_emissions({ facility_name: "EXXONMOBIL", state: "TX" })
// → { ..., "facilities": [
//     { "name": "EXXONMOBIL Bt Site", "city": "BAYTOWN", "total_ghg_emissions_mt_co2e": 94894787.79, ... },
//     { "name": "Exxonmobil Beaumont Refinery", ... },
//     ...
//   ] }

ECHO, GHGRP, and TRI are independent EPA data programs with independently self-reported facility names for the same physical plant — “BAYTOWN OLEFINS PLANT” (ECHO) is “EXXONMOBIL Bt Site” (GHGRP) is “EXXONMOBIL CHEMICAL CO BAYTOWN OLEFINS PLANT (PART)” (TRI, verified below). A count: 0 from any one of these tools is not evidence the facility is clean in that dimension — it’s as likely evidence you searched under the wrong program’s name for it. Search each dataset independently with the parent company name broadened ("EXXONMOBIL", not the ECHO facility name), then match by city/coordinates, not by name string.

A second, subtler trap sits right next to this one: tri_facility_releases takes a parameter named facility_name. Pass a different key name by mistake (the original version of this recipe called it name) and the tool doesn’t error — it silently ignores the unrecognized key and returns every TRI facility in the state:

tri_facility_releases({ name: "Baytown Olefins", state: "TX" })   // wrong param
// → { count: 21, facilities: [ "HEP JAVELINA SMR LLC", "AIRBORN INC.", "BASF CORP", ... ] }
//   — 21 real TX facilities, none of them Baytown Olefins, no error raised
tri_facility_releases({ facility_name: "Baytown Olefins", state: "TX" })   // correct param
// → { count: 1, facilities: [ { tri_facility_id: "77522XXNCH3525D",
//     name: "EXXONMOBIL CHEMICAL CO BAYTOWN OLEFINS PLANT (PART)", city: "BAYTOWN", ... } ] }

Both calls return a full, real, well-formed facility list. Only the second one is about your facility. There is no error to catch — check that the facility your filter was supposed to narrow to is actually present in the response before reporting a count.

Step-by-step tool calls

1. EPA enforcement

echo_facility_search({ facility_name: "%EXXONMOBIL BAYTOWN%", state: "TX" })

The parameter is facility_name, not name — it supports SQL-style %wildcard% matching. At least one of facility_name, state, zip, city, or naics is required — a bare state alone is rejected as too broad.

2. Greenhouse-gas emissions

ghg_facility_emissions({ facility_name: "EXXONMOBIL", state: "TX" })

state is required (this dataset is state-scoped, not searchable nationally). Data lags ~1.5 years — the latest full year (currently 2023) is auto-selected unless you pass year. Search broad on the parent-company name, not the exact ECHO facility name — see the naming-mismatch finding above — then match the result to your facility by city/coordinates.

3. Toxic Release Inventory

tri_facility_releases({ facility_name: "Baytown Olefins", state: "TX" })

state is required; facility_name is the correct key (see the silent-wrong-data trap above). Returns facility identity only — chain the tri_facility_id into tri_chemical_releases for the actual chemical-by-chemical release data.

4. Local air quality

air_quality_near({ latitude: 29.73934, longitude: -95.022404 })

Use the coordinates from the ECHO record. Returns the nearest OpenAQ station and its latest readings. Check the datetime on each reading before calling it current — live-verified for this exact facility, the nearest station’s readings were dated 2016-03-06, a decade stale, in an otherwise normal-looking response with real sensor IDs and units. OpenAQ’s other_nearby list gives you alternate stations to try if the nearest one is stale.

5. Pending rules

federal_register_search_documents({ query: "petroleum refining emissions" })

Note the explicit federal_register_ prefix — search_documents is also exported by two other packs (Swedish parliament documents, PTAB patent trials); the bare name currently auto-resolves to Federal Register via the collision router, but naming it explicitly is the reliable form. Use NAICS-relevant industry terms, not the company name — a company-name search returns whatever happens to mention it in passing (a query: "Microsoft" search returned 10,000 hits, the top ones being IRS meeting notices held over “Microsoft Teams” — nothing to do with Microsoft the company). Pass since to avoid decade-old low-relevance hits on sparse queries.

Risk tier

Roll up to Low / Moderate / High / Severe:

  • Severe: open formal enforcement action, top-tier emitter, recent TRI spike, multiple pending rules
  • High: any open enforcement OR top-tier emissions OR recent TRI increase OR multiple pending rules
  • Moderate: historical violations resolved, mid-tier emissions, stable TRI, isolated pending rules
  • Low: clean enforcement record, low emitter, stable or declining TRI, no industry-relevant pending rules

Citation pattern

Baytown Olefins Plant (Baytown, TX; EPA registry 110000463178): CAA violation addressed with EPA as lead enforcement, 4 formal enforcement actions, $2.2M in total penalties per ECHO. Reports to GHGRP as “EXXONMOBIL Bt Site” — 94.8M metric tons CO2e in 2023, among the largest emitters in Texas. TRI: registered as “EXXONMOBIL CHEMICAL CO BAYTOWN OLEFINS PLANT (PART)” — pull tri_chemical_releases for the chemical breakdown. Nearest OpenAQ station reading was from 2016 — no current air-quality signal available for this site. Tier: High.

Use the prompt

prompts/get({
  name: "environmental_risk",
  arguments: { subject: "Baytown Olefins Plant" }
})

Caveats

  • Facility names do not carry across EPA programs. ECHO, GHGRP, and TRI each use independently self-reported names for the same physical facility — a count: 0 in one program is not evidence of a clean record, it may just be the wrong name. Search broad (parent company) and match by location, not by name string. See the live example above.
  • tri_facility_releases silently ignores an unrecognized parameter name rather than erroring — the correct key is facility_name, not name. A typo here returns a full, plausible-looking, completely unrelated result set.
  • Self-reported emissions. GHG reporting is mandatory above thresholds, but TRI uses self-reported estimates. Year-over-year jumps may reflect methodology changes, not actual emissions changes.
  • Air-quality readings can be years stale. Always check the datetime field on readings — a nearest-station match does not guarantee a recent one. other_nearby lists alternates.
  • search_documents collides across three packs (Federal Register, Swedish Riksdagen, USPTO PTAB). Call federal_register_search_documents explicitly rather than relying on the bare name’s current auto-routing.
  • Pending-rules search is noisy on a company name. Use NAICS-aware/topical search terms and a since window, then filter to rules at the comment-period or final-rule stage.

Last reviewed August 6, 2026