# CSI Spec Slicer & Procore Submittal Extractor (`bedraggler/csi-spec-submittal-extractor`) Actor

Deterministic construction PDF parser extracting Procore submittal logs, Basis-of-Design manufacturers, MEP Div 23/26 clashes, and contract risk redlines with exact page citations.

- **URL**: https://apify.com/bedraggler/csi-spec-submittal-extractor.md
- **Developed by:** [Landon Carpenter](https://apify.com/bedraggler) (community)
- **Categories:** AI, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.00 / 1,000 extracted submittal / risk / conflict rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## CSI MasterFormat Spec Slicer & Procore Submittal Extractor

Deterministic, zero-hallucination **construction specification PDF parser** that slices multi-hundred-page CSI MasterFormat Project Manuals into structured engineering & estimating deliverables:

- **Procore-Ready Master Submittal Register (`Master_Submittal_Register_Procore_Ready.csv`)** — Extracts Part 1 Submittals (`PRODUCT_DATA`, `SHOP_DRAWINGS`, `DELEGATED_DESIGN_PE_STAMP`, `SOURCE_QUALITY_CONTROL_FAT`, `TEST_AND_COORDINATION_STUDY`, `CLOSEOUT_AND_OM`), classifies `NEEDS_PE_REVIEW` vs. `DETERMINISTIC_CHECK`, and tags critical lead-time gates.
- **Contract & Hidden Spec Cost-Driver Redlines** — Flags uncapped Liquidated Damages (`VETO_OVERRIDE`), Pay-if-Paid traps, No-Damage-for-Delay waivers, mandatory LOD 400 BIM modeling, L1–L5 load-bank/FAT commissioning mandates, RGS conduit / NEMA 4X 316SS upgrades, ARI 550 invoice holdbacks, and VA native BACnet zero-gateway clauses—plus any user-supplied `customRiskKeywords`.
- **Basis-of-Design (BoD) Manufacturer & Substitution Matrix** — Captures primary BoD brands, approved equals, substitution policy (`NO_SUBSTITUTIONS`, `PRIOR_APPROVAL_REQUIRED`, `OR_EQUAL_ALLOWED`), and key technical constraints.
- **ASHRAE Guideline 36 & BACnet Sequence Audit** — Detects missing BAS points (`VAV_DAMPER_POS`), blank Trim-and-Respond parameters (`SP_0`, `T_max`), ambiguous sequence sentences, and native BACnet hardware risks.
- **Division 23 vs. Division 26 Cross-Trade Alignment** — Flags MCA vs. breaker trip mismatches, equipment SCCR vs. available fault current (AIC) blockers, and voltage/phase conflicts.
- **Executive Audit Deliverables** — Exports both a branded multi-page PDF (`Executive_MEP_Bid_and_Submittal_Audit.pdf`) and a full Markdown/JSON bundle (`Executive_MEP_Bid_and_Submittal_Audit.md`, `OUTPUT`), all backed by exact **CSI section, paragraph ID, PDF page number, and verbatim quote citations**.

***

### Why Deterministic PyMuPDF Beats Raw LLM PDF Chunking

Standard AI agents and RAG pipelines routinely hallucinate CSI section numbers, drop buried Part 2 material upgrades across 400+ pages, or miss strict substitution lockouts. This Actor uses a deterministic **PyMuPDF + Pydantic v2** section slicer and rule engine:

1. **100% Verbatim Citation Grounding:** Every single finding carries `csi_section`, `paragraph_id`, `page_number`, and an exact `verbatim_quote` substring from the source PDF.
2. **Zero GPU / Minimal Runtime Cost:** Runs purely on fast CPU parsing, making it ideal for high-volume preconstruction desks, automated bid-board pipelines, and AI agents.
3. **Procore & Autodesk Build Ready:** Download `Master_Submittal_Register_Procore_Ready.csv` directly from the run's Key-Value Store and import straight into Procore Submittals.

***

### Using with AI Agents (Apify MCP Server) & Automation (n8n / Make)

#### Via MCP (`mcp.apify.com`)

Connect Claude, Cursor, or any MCP-compatible assistant to `https://mcp.apify.com/` and call `csi-spec-submittal-extractor` with a PDF URL (`pdfUrls`) or leave inputs empty (`runBuiltInSampleIfEmpty: true`) to test on the built-in 7-page 12MW Hyperscale Data Center MEP specification sample.

#### Via n8n / Make / Webhook Pipelines

1. Trigger on new invitation-to-bid (ITB) emails or Procore/BuildingConnected uploads.
2. Pass the specification PDF URL (`pdfUrls`) or base64 payload (`pdfBase64`), optional `divisionsFilter` (e.g. `["00", "01", "23", "26"]`), and `customRiskKeywords` (e.g. `["Buy America", "PFAS"]`).
3. Consume structured JSON from the Dataset or fetch `Master_Submittal_Register_Procore_Ready.csv` and `Executive_MEP_Bid_and_Submittal_Audit.pdf` directly from the Key-Value Store output links.

***

### Input Parameters

| Field | Type | Description | Default |
| :--- | :--- | :--- | :--- |
| `pdfUrls` | `string[]` | Direct HTTP/HTTPS URLs to CSI specification PDFs. | `[]` |
| `pdfBase64` | `string` | Optional base64-encoded PDF bytes for webhook/API callers. | `""` |
| `projectName` | `string` | Project title shown in exported PDF/Markdown reports and dataset items. | `"Commercial / Mission-Critical MEP Spec Audit"` |
| `divisionsFilter` | `string[]` | Optional 2-digit CSI divisions to audit (e.g. `["23", "26"]`). Empty parses all. | `[]` |
| `customRiskKeywords` | `string[]` | Custom phrases to flag with exact paragraph & page citations. | `[]` |
| `maxPages` | `integer` | Page cap per PDF (1–2,500) to bound run cost. | `500` |
| `runBuiltInSampleIfEmpty` | `boolean` | Runs the built-in 7-page 12MW Hyperscale MEP benchmark PDF when no PDF input is supplied. | `true` |

***

### Pay-Per-Event (PPE) Pricing Structure

You pay only for documents, pages, and structured findings successfully extracted:

| Event Name | Trigger |
| :--- | :--- |
| `spec-document-initialized` | Once per specification PDF parsed |
| `spec-page-parsed` | Per PDF page sliced and audited |
| `extracted-finding-row` | Per validated finding row pushed to Dataset (Submittal, Risk Flag, BoD Manufacturer, Sequence Gap, or Cross-Trade Clash) |

# Actor input Schema

## `pdfUrls` (type: `array`):

Direct HTTP/HTTPS URLs to CSI MasterFormat construction specification manual PDFs.

## `pdfBase64` (type: `string`):

Optional base64-encoded PDF file content (useful for n8n, Make, Zapier, or MCP agent integrations).

## `projectName` (type: `string`):

Project title displayed in the exported Executive Audit PDF, Markdown report, and dataset rows.

## `divisionsFilter` (type: `array`):

Optional 2-digit CSI division codes (e.g. \["00", "01", "23", "26"]). Leave empty to audit all CSI divisions.

## `customRiskKeywords` (type: `array`):

Optional commercial or technical keywords (e.g. "Buy America", "Owner-Furnished", "PFAS") to flag with exact page citations.

## `maxPages` (type: `integer`):

Safety limit on PDF pages processed per document to cap Pay-Per-Event spend.

## `runBuiltInSampleIfEmpty` (type: `boolean`):

When no pdfUrls or pdfBase64 is supplied, generate and audit a realistic 7-page 12MW Data Center MEP specification manual.

## Actor input object example

```json
{
  "pdfUrls": [],
  "projectName": "Commercial / Mission-Critical MEP Spec Audit",
  "divisionsFilter": [],
  "customRiskKeywords": [],
  "maxPages": 500,
  "runBuiltInSampleIfEmpty": true
}
```

# Actor output Schema

## `findingsDataset` (type: `string`):

No description

## `procoreSubmittalCsv` (type: `string`):

No description

## `executiveAuditPdf` (type: `string`):

No description

## `executiveAuditMarkdown` (type: `string`):

No description

## `structuredAuditJson` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "projectName": "Commercial / Mission-Critical MEP Spec Audit"
};

// Run the Actor and wait for it to finish
const run = await client.actor("bedraggler/csi-spec-submittal-extractor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "projectName": "Commercial / Mission-Critical MEP Spec Audit" }

# Run the Actor and wait for it to finish
run = client.actor("bedraggler/csi-spec-submittal-extractor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "projectName": "Commercial / Mission-Critical MEP Spec Audit"
}' |
apify call bedraggler/csi-spec-submittal-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,bedraggler/csi-spec-submittal-extractor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/flmIoPojSWP6QIWd8/builds/zarEt7iMcoguSQdww/openapi.json
