Skip to main content
Glama
NYC Open Data Capital Projects MCP Server

NYC Open Data Capital Projects MCP Server

by WillHsiaoNYC

NYC Open Data — Capital Projects MCP Server

A local MCP server over the NYC Capital Projects Dashboard (CPD) datasets on NYC Open Data. It ingests four public Socrata datasets into a single local DuckDB and exposes 18 tools so an AI assistant can answer schedule, budget, and lifecycle questions about NYC capital projects — with the domain rules (PID↔FMS many-to-many, role-aware agency attribution, signed variance reporting) baked into the tools instead of left for the caller to rediscover.

Source datasets (Socrata)

ID

Dataset

fb86-vt7u

Citywide Capital Project List Detail (the schedule↔budget edge)

gyhf-rsr3

Citywide Budget & Spend by FY

qj5n-h5qp

Citywide Budget Spend History & Variance

95tx-snak

Citywide Schedule History & Variance

Related MCP server: Akil MCP

What's an MCP — and why use one?

MCP (Model Context Protocol) is a standard way to give an AI assistant a new, trusted skill. Instead of pasting a spreadsheet into a chat and hoping the model reads it right, you hand it a set of well-defined tools it can call — with the domain rules already baked in. It's the difference between telling an analyst "here's a spreadsheet, good luck" and hiring one who already knows the data cold.

Why not just ChatGPT + a CSV? Public data is messy in ways a generic chatbot can't see. Ask a raw LLM "what's NYC's biggest library project?" and it'll happily double-count a budget line shared by several projects, call a long-finished branch "still under construction" because its funding line is still open, or — seeing only three reporting periods a year (Jan / May / Sep) — assume months of data have gone missing. It sounds confident — and it's wrong. This server encodes the guardrails once — the PID↔FMS many-to-many, role-aware agency attribution, the 3×-a-year reporting cadence, signed reporting — so every answer is consistent, sourced, and reproducible.

What one prompt can build

This isn't only a query tool. Point an AI agent at it and a single prompt produces a polished, self-contained interactive HTML report — with the domain rules already applied. Four real examples (one prompt → one file; click to open the live report):

1 · NYC capital projects overview — a first-timer's field guide to the dataset

Use this MCP to create a general overview of project schedule/budget and agency count for first-timer to quickly understand the coverage of the dataset, in an html file for presentation.

▶ Open the presentation — a nine-slide introduction to the dataset's schedule and budget units, reporting coverage, lifecycle mix, budget and spend, agency roles, and category coverage.

2 · Schedule ↔ Budget topology — the many-to-many anatomy of the portfolio

Analyze the schedule and budget many-to-many relationship across NYC capital projects and build a single interactive HTML report — the 1:1-vs-fan-out split, the outlier extremes, a per-agency breakdown, and budget concentration.

▶ Open the report — fan-out rings, a bipartite diagram, the "tangled few" outliers (hover to see the real schedules and budget lines), an agency scatter, and a budget concentration curve.

3 · Parks projects over $50M — every big build, and what funds it

Build an interactive one-file HTML report on NYC Parks projects over $50M. For each budget line, show every schedule associated with it, with phase and forecast completion.

▶ Open the report — 23 budget lines; hover any to reveal its linked schedules. Quietly applies the category taxonomy, so the $1.9B "Park Pedestrian Bridges" route to Bridges, not Parks.

4 · Budget & schedule change monitor — what moved this period, by agency

Build an interactive one-file HTML monitor of NYC capital projects' budget and schedule changes by managing agency, with a click-through detail view for each project's schedule and budget history.

▶ Open the report — KPIs, a trend chart, a sortable watchlist, and a per-project popup with schedule-variance bars and a stacked budget-vs-spend chart.

Each report was generated from the prompt shown, then lightly polished. The overview uses reporting period 202605; the other three use 202601. Browse all four in the report gallery.

The Fordham University class reports and data tools have a separate index with report links and a historical CPD MCP installation guide. The historical code-only package uses the course Excel supplied separately to students; its legacy PIDs are distinct from the current MCP’s IDs.

🚀 Quick Start

Want the data without the setup? If your AI can run commands on your computer, just ask it to install everything for you.

✅ Let your AI install it (easiest)

Works with AI agents that can run terminal commands — Claude Code, Claude cowork (Claude Desktop's local-agent mode), Codex CLI, or another coding agent like Cursor.

  1. Start your AI agent on this computer.

  2. Paste the message below.

  3. Approve each step (Allow, or press y) as it clones, installs, and connects the server.

Message to paste:

Install the MCP server at
https://github.com/WillHsiaoNYC/NYC-Opendata-Capital-Projects-MCP on this
machine — follow its README to clone the repo, install it with uv, run
`od-cpd init --source opendata` to download all four datasets into a local
database, and wire it into my MCP client config. If Open Data downloads
fail, explain the GitHub snapshot fallback and ask before switching to
`--source github`. Report the source, snapshot download date when applicable,
and loaded reporting periods. Then run a verification query to confirm it works.

What "done" looks like: your AI reports the loaded reporting period (e.g. 202605), confirms od-cpd is connected with its 18 tools, and answers a test question like "What's the biggest NYC capital project right now?" Takes a few minutes, mostly the dataset download.

🖥️ Claude Desktop (chat)

Claude Desktop can use a local server but can't install one itself. Run the Manual install, then add od-cpd to its own config (with the absolute path to uv) and fully restart — see Connect an MCP client.

☁️ claude.ai or ChatGPT (web)

These connect only to remote MCP servers, not a local one like this — so they can't run od-cpd directly. Use one of the options above.

Manual install

Requires Python ≥ 3.12 and uv.

git clone https://github.com/WillHsiaoNYC/NYC-Opendata-Capital-Projects-MCP.git
cd NYC-Opendata-Capital-Projects-MCP

uv sync --locked
uv run od-cpd init        # download + materialize all 4 datasets → ./var/cpd.duckdb
uv run od-cpd status      # confirm the loaded reporting period

Optional: set OD_CPD_SOCRATA_APP_TOKEN to a free Socrata app token to avoid anonymous rate limits during ingest.

Choosing a download source

NYC Open Data is the default and supplies the current published files. The installer downloads complete CSVs through Socrata's v3 export service with bounded retries. It explicitly selects every native column as text to preserve values; ordinary website exports can format or round currency, percentages, and dates. Metadata validates the fields and maps headers automatically. Users and installing agents do not need to rename columns or transform values.

uv run od-cpd init --source opendata
uv run od-cpd init --source github                   # release tag data-latest
uv run od-cpd init --source github --release TAG     # choose a dated snapshot

GitHub snapshots are release attachments in this repository, not files in Git history. The default data-latest tag is a maintainer-managed data snapshot; it does not mean GitHub's latest software release. A snapshot can be older than Open Data. Check its download date and reporting periods before choosing it. The GitHub path needs no live Socrata access: its manifest supplies source metadata, field mappings, row counts, byte counts, and SHA-256 checksums. Downloads are pinned to release asset IDs in this repository. Both sources pass schema, completeness, and database health checks before publication. An older source revision cannot replace newer local data, even within the same reporting period; use a separate database to explore an older snapshot.

Downloads never silently switch sources. On an Open Data failure, the CLI exits with a suggested GitHub command; it does not start an interactive prompt. An installing agent should explain that fallback and obtain the user's source choice, or honor a source choice already provided. Report the chosen source and freshness after installation. If the requested snapshot has not been published, the GitHub path fails clearly; adding this option does not itself publish assets.

Connect an MCP client

The server speaks stdio. Use the absolute path to uv (run which uv to find it) — GUI apps like Claude Desktop don't inherit your shell PATH, so a bare uv command fails silently.

Claude Code — from inside the repo folder:

claude mcp add od-cpd --env PYTHONPATH="$(pwd)/src" -- \
  "$(which uv)" run --directory "$(pwd)" od-cpd-server

Claude Desktop — edit its config (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json), add the block below, then fully quit (⌘Q) and reopen Claude Desktop:

{
  "mcpServers": {
    "od-cpd": {
      "command": "/absolute/path/to/uv",
      "args": ["run", "--directory", "/absolute/path/to/repo", "od-cpd-server"],
      "env": { "PYTHONPATH": "/absolute/path/to/repo/src" }
    }
  }
}

(PYTHONPATH keeps the launch robust when uv's editable install is flaky — e.g. on iCloud-synced paths.)

Keeping data fresh

The source datasets report on a Jan / May / Sep cycle, and Socrata typically publishes each period ~2.5–3 months later (so new data usually lands around April, August, and December). Source revision times and reporting periods are separate: check both before interpreting freshness.

uv run od-cpd status                    # local period, ingestion time and build
uv run od-cpd status --check-upstream   # verify source revisions and complete periods
uv run od-cpd update                    # check revisions; fully reload if sources changed
uv run od-cpd update --force            # fully reload even if revisions appear unchanged
uv run od-cpd update --source github    # fully reload the selected GitHub snapshot
uv run od-cpd rematerialize             # rebuild local raw data without downloading

Every data refresh downloads all four datasets in full and rebuilds the database, including historical records. There is no incremental append: Open Data can backfill or correct older records. The default Open Data update checks source revisions first and skips downloading when unchanged; use --force to require a full refresh regardless. A GitHub update always downloads and rebuilds from the selected release (--release TAG, default data-latest). Refreshing a GitHub snapshot does not make it newer than the files its maintainer published.

Refresh and rematerialization build in an isolated shadow, validate its inputs, then atomically replace the database. Before/after health reports remain under var/ingest-runs/; a failed build preserves the prior database and its diagnostics. Reconnect MCP clients after changing server code. See docs/FEATURES.md for snapshot scopes, source-coverage reconciliation and export provenance. status and MCP build provenance retain the download source and, for GitHub snapshots, the release and snapshot date, including after rematerialization.

To keep it fresh automatically, schedule update (e.g. monthly via cron):

# 9am on the 1st of each month
0 9 1 * * cd /path/to/repo && uv run od-cpd update

Preparing GitHub snapshots (maintainers)

uv run od-cpd snapshot /path/to/new-snapshot-directory

The output directory must not already exist. This command downloads and validates all four lossless CSV exports and creates manifest.json, without touching the live database. Assets retain the exact bytes returned by the text projection export. The manifest marks this format as socrata-text-v1 and records source URLs, metadata mappings, download dates, reporting periods, row counts, byte counts, and SHA-256 checksums. Ordinary website exports are not substitutes for these assets.

Publish those five files together as assets of a dated GitHub release in this repository. Publishing is a separate maintainer action; the snapshot command does not create or upload a release. Optionally promote a complete, validated snapshot to the data-latest release. Never commit the generated CSVs to Git. Keep dated releases available for users who pin --release TAG, and publish the snapshot date and reporting periods in the release notes. Until a maintainer publishes a complete snapshot, the GitHub fallback is unavailable.

What's inside

  • docs/FEATURES.md — the canonical inventory: all 18 tools and every domain rule the server encodes. Start here.

The headline domain rules, briefly:

  • "Project" is ambiguous. A PID identifies a schedule; an FMS ID identifies a budget line. They are many-to-many (~3% fan out), so the tools list all counterparts rather than silently picking one.

  • Agency attribution is role-aware. "Agency X's projects" means the sponsor (owner) view for normal agencies, but the managing (builder) view for the three construction-manager agencies (DDC/DCAS/EDC).

  • Values are reported signed and neutral ("moved 45 days later", "budget grew $2.1M") rather than only surfacing one direction.

Layout

  • src/od_cpd/ — ingest, materialization, and the MCP server + tools

  • data/ — curated agency/category dictionaries (YAML, tracked)

  • tests/ — unit tests + golden evals (uv run pytest)

  • var/, exports/ — runtime DuckDB + exports (gitignored, regenerable)

Develop

uv run pytest             # fallback: PYTHONPATH=src python -m pytest

Classification is dictionary-driven: edit data/agencies.yaml / data/categories.yaml (not Python) to adjust agency or category mappings, then re-materialize. See CLAUDE.md for the atomic-swap pattern that applies materialization changes without re-downloading.

Data caveats

This is an independent project, not affiliated with the City of New York. Figures reflect whatever reporting period the underlying Socrata datasets carry at ingest time; always check dataset_info for the current period and per-dataset caveats.

Available Tools

18 tools
budget_breakdownA
Read-onlyIdempotent

Total budget / spend by managing_agency or category, deduped on (fms_id, managing_agency). Category is line-grain (additive). Optional agency scopes to one agency; agency_role ('auto'|'sponsor'|'managing') picks owner vs builder lens. For richer cuts use run_sql.

Interpretation rules:

  • [grain] Schedule questions use PID; budget questions use the BUDGET LINE key (managing_agency, fms_id). The same FMS ID under different holders is distinct lines. Schedule history is PID x reporting_period; budget history is budget line x reporting_period; fiscal-year budgets also key on fiscal_year. The schedule source has no fms_id; budget sources have no pid. The combined source repeats rows across PID-budget links and location splits: deduplicate at the requested entity grain before counting or summing. Never compare budgets using fms_id alone.

  • [period_basis] Reporting-period basis: state the returned period for every count, total or ranking and both periods for comparisons. Period aggregates default to the latest complete snapshot, which may precede a partially published newer period. fms_location, fms_sponsor and lifetime_budget_variance are all-history dimensions without reporting_period: use them for enrichment or lifetime figures, never as a single period's inventory.

  • [agency_roles] Agency attribution is role-aware: an agency's projects mean its sponsor (owner) view, except DDC/DCAS/EDC default to managing (builder). State the returned agency_scope. managing_agency is the executor on schedules and the budget-holder on budgets; a budget-only holder is not a schedule executor. list_agencies exposes is_schedule_executor. For sponsor-scoped budget totals, use a semi-join to fms_sponsor; a value-bearing join can multiply lines. Co-owner totals can overlap and must not be added together.

  • [categories] Classify with the curated category_dim, not project-name searches: specific ten-year labels/FMS prefixes precede sponsor routing, then generic facility keywords and Other. Categories key on (managing_agency, fms_id); institution owner rules can use all-history ownership. Schedule category_scope='current' uses each PID's current funding links; 'all_history' includes former links. A PID can count in multiple categories, so schedule category counts are non-additive; each budget line has one category.

Inputs: agency, metric, period, group_by, +1 more. Returns: groups, metric, period, provenance, +1 more

budget_changeA
Read-onlyIdempotent

Δ budget/spend for an agency ('agency:DEP') or FMS line ('fms:ABC') between two periods. For an agency target, agency_role ('auto'|'sponsor'|'managing') picks the lens; sponsor scope uses the latest-period owner set (as-of caveat in the result label). An FMS id held by several managing agencies is several distinct budget lines: the result then lists per-line deltas (never a cross-agency sum); pass managing_agency to scope to one line.

Interpretation rules:

  • [grain] Schedule questions use PID; budget questions use the BUDGET LINE key (managing_agency, fms_id). The same FMS ID under different holders is distinct lines. Schedule history is PID x reporting_period; budget history is budget line x reporting_period; fiscal-year budgets also key on fiscal_year. The schedule source has no fms_id; budget sources have no pid. The combined source repeats rows across PID-budget links and location splits: deduplicate at the requested entity grain before counting or summing. Never compare budgets using fms_id alone.

  • [period_basis] Reporting-period basis: state the returned period for every count, total or ranking and both periods for comparisons. Period aggregates default to the latest complete snapshot, which may precede a partially published newer period. fms_location, fms_sponsor and lifetime_budget_variance are all-history dimensions without reporting_period: use them for enrichment or lifetime figures, never as a single period's inventory.

  • [agency_roles] Agency attribution is role-aware: an agency's projects mean its sponsor (owner) view, except DDC/DCAS/EDC default to managing (builder). State the returned agency_scope. managing_agency is the executor on schedules and the budget-holder on budgets; a budget-only holder is not a schedule executor. list_agencies exposes is_schedule_executor. For sponsor-scoped budget totals, use a semi-join to fms_sponsor; a value-bearing join can multiply lines. Co-owner totals can overlap and must not be added together.

  • [budget_baseline] budget_variance is change from the previous reporting period; cumulative_budget_change is latest minus original. State which basis is used. original_budget prefers the adopted first budget, with first_snapshot as fallback: disclose original_budget_source. Adoption months are calendar months from a separate first-budget system, not reporting snapshots.

  • [signed_values] Report neutral, SIGNED changes: "moved 45 days later" or "budget decreased $2M". Do not echo loaded terms in the answer. "slippage" means positive schedule change and "overrun" means positive budget growth; neither includes the decreasing side. Preserve the returned direction and metric basis.

Inputs: target (required), to_period (required), from_period (required), metric, +2 more. Returns: change, target, provenance, interpretation_rules

dataset_infoA
Read-onlyIdempotent

Per-dataset freshness, current period, row counts, and the key caveats.

Interpretation rules:

  • [freshness] Reporting snapshots publish three times yearly (Jan/May/Sep, YYYYMM ending 01/05/09). Reporting periods, source revisions and ingestion timestamps are different clocks. dataset_info is local-only metadata, not an upstream freshness check. Use its available periods and complete snapshot information when choosing a comparison.

  • [period_basis] Reporting-period basis: state the returned period for every count, total or ranking and both periods for comparisons. Period aggregates default to the latest complete snapshot, which may precede a partially published newer period. fms_location, fms_sponsor and lifetime_budget_variance are all-history dimensions without reporting_period: use them for enrichment or lifetime figures, never as a single period's inventory.

Inputs: no named parameters. Returns: caveats, datasets, provenance, domain_rules, +1 more

delay_reason_statsB
Read-onlyIdempotent

Distribution of reason-for-delay (only populated when variance>0). Defaults to current period; pass scope='all_history' for lifetime. Carries a coverage block (delayed_total / with_reason / without_reason — the denominator for the distribution, counting delayed rows by bare variance_day>0). agency_role ('auto'|'sponsor'|'managing') picks owner vs builder lens.

Interpretation rules:

  • [period_basis] Reporting-period basis: state the returned period for every count, total or ranking and both periods for comparisons. Period aggregates default to the latest complete snapshot, which may precede a partially published newer period. fms_location, fms_sponsor and lifetime_budget_variance are all-history dimensions without reporting_period: use them for enrichment or lifetime figures, never as a single period's inventory.

  • [agency_roles] Agency attribution is role-aware: an agency's projects mean its sponsor (owner) view, except DDC/DCAS/EDC default to managing (builder). State the returned agency_scope. managing_agency is the executor on schedules and the budget-holder on budgets; a budget-only holder is not a schedule executor. list_agencies exposes is_schedule_executor. For sponsor-scoped budget totals, use a semi-join to fms_sponsor; a value-bearing join can multiply lines. Co-owner totals can overlap and must not be added together.

  • [schedule_coverage] Schedule totals and cumulative variance use dashboard-aligned schedule_history. source_schedule_history retains native observations absent from that population; schedule_source_coverage reconciles them. State the schedule universe and cumulative basis. Parenthesized phases are no-schedule reasons. Respect excluded variance artifacts and missing/invalid-duration counts; forward duration statistics exclude reversed dates.

  • [signed_values] Report neutral, SIGNED changes: "moved 45 days later" or "budget decreased $2M". Do not echo loaded terms in the answer. "slippage" means positive schedule change and "overrun" means positive budget growth; neither includes the decreasing side. Preserve the returned direction and metric basis.

Inputs: scope, agency, period, agency_role. Returns: reasons, coverage, provenance, interpretation_rules

describe_fieldA
Read-onlyIdempotent

Official field definitions (the NYC Open Data data dictionary): description, allowed values, primary/foreign key, limitations, notes. Filter by field (column name or display name) and/or dataset (RAW table name or socrata_id); omit both for the full dictionary.

Interpretation rules:

  • [grain] Schedule questions use PID; budget questions use the BUDGET LINE key (managing_agency, fms_id). The same FMS ID under different holders is distinct lines. Schedule history is PID x reporting_period; budget history is budget line x reporting_period; fiscal-year budgets also key on fiscal_year. The schedule source has no fms_id; budget sources have no pid. The combined source repeats rows across PID-budget links and location splits: deduplicate at the requested entity grain before counting or summing. Never compare budgets using fms_id alone.

  • [lifecycle] Lifecycle: Pre-Design -> Design -> Construction Procurement -> Construction -> Close-out. Schedule progression is reported from Design through Construction. Forecasts and most actual milestones can be suppressed outside those phases; actual_construction_end is the exception and means substantial completion. NULL milestones need not mean missing data. Budget spend%=100 does not prove completion. forecast_past_due is evaluated as of the observation period, not today's date.

Inputs: field, dataset. Returns: fields, provenance, interpretation_rules

describe_tableA
Read-onlyIdempotent

Schema catalog for every queryable DuckDB table (typed analytics tables, dims, raw mirrors): live columns + types plus curated grain and keying notes. No arg → catalog of all tables; table= (case-insensitive) → full detail. Use this instead of DESCRIBE/SHOW (blocked in run_sql). Complements describe_field (official field semantics for the 4 raw datasets).

Interpretation rules:

  • [grain] Schedule questions use PID; budget questions use the BUDGET LINE key (managing_agency, fms_id). The same FMS ID under different holders is distinct lines. Schedule history is PID x reporting_period; budget history is budget line x reporting_period; fiscal-year budgets also key on fiscal_year. The schedule source has no fms_id; budget sources have no pid. The combined source repeats rows across PID-budget links and location splits: deduplicate at the requested entity grain before counting or summing. Never compare budgets using fms_id alone.

  • [period_basis] Reporting-period basis: state the returned period for every count, total or ranking and both periods for comparisons. Period aggregates default to the latest complete snapshot, which may precede a partially published newer period. fms_location, fms_sponsor and lifetime_budget_variance are all-history dimensions without reporting_period: use them for enrichment or lifetime figures, never as a single period's inventory.

  • [sql_usage] Prefer purpose-built tools for supported questions. For custom SQL, use describe_table for grain/keying and describe_field for field definitions, then prefer typed tables. Raw mirrors are VARCHAR and need casts. run_sql enforces read-only access, not correct analytical grain: the caller must prevent join fan-out and choose the period/population. Disclose truncated results; use CSV/XLSX for the full result when needed.

Inputs: table. Returns: table, tables, columns, provenance, +1 more

get_project_budgetA
Read-onlyIdempotent

Budget (FMS line): total, spend, variance; lists linked schedules. NB budget has no 'completed' state; spend%=100 ≠ done.

Interpretation rules:

  • [relationships] "Project" is ambiguous: PID identifies a SCHEDULE; FMS ID identifies a BUDGET. They are MANY-TO-MANY: a budget can fund several PIDs and a PID can have several budgets. LIST ALL linked counterparts; never silently select one. One linked counterpart does not establish a 1:1 relationship in the reverse direction. A budget without a PID is normal before Design and for lines that do not require schedules; absence alone does not establish missing data. Source-only schedules can also lack dashboard funding links.

  • [grain] Schedule questions use PID; budget questions use the BUDGET LINE key (managing_agency, fms_id). The same FMS ID under different holders is distinct lines. Schedule history is PID x reporting_period; budget history is budget line x reporting_period; fiscal-year budgets also key on fiscal_year. The schedule source has no fms_id; budget sources have no pid. The combined source repeats rows across PID-budget links and location splits: deduplicate at the requested entity grain before counting or summing. Never compare budgets using fms_id alone.

  • [population] Listings/rankings default to population_scope='latest_known' (each entity's own latest observation). Use population_scope='current' for the selected complete snapshot. State the population_scope and observation period; respect present_in_current_snapshot. Detail tools use latest-known state and each anchor's latest available link period; these links are not proof of presence in the current complete snapshot.

  • [budget_baseline] budget_variance is change from the previous reporting period; cumulative_budget_change is latest minus original. State which basis is used. original_budget prefers the adopted first budget, with first_snapshot as fallback: disclose original_budget_source. Adoption months are calendar months from a separate first-budget system, not reporting snapshots.

  • [lifecycle] Lifecycle: Pre-Design -> Design -> Construction Procurement -> Construction -> Close-out. Schedule progression is reported from Design through Construction. Forecasts and most actual milestones can be suppressed outside those phases; actual_construction_end is the exception and means substantial completion. NULL milestones need not mean missing data. Budget spend%=100 does not prove completion. forecast_past_due is evaluated as of the observation period, not today's date.

  • [signed_values] Report neutral, SIGNED changes: "moved 45 days later" or "budget decreased $2M". Do not echo loaded terms in the answer. "slippage" means positive schedule change and "overrun" means positive budget growth; neither includes the decreasing side. Preserve the returned direction and metric basis.

Inputs: fms_id (required), managing_agency. Returns: answer, provenance, linked_schedules, interpretation_rules

get_project_historyA
Read-onlyIdempotent

Period-by-period history for ONE project. Schedule lens (pid=…): each period's phase, forecast, signed variance, delay reason + a current-state header carrying agency_project_name, cumulative variance, and forecast_past_due (see get_project_schedule). Budget lens (fms_id=…, case-insensitive): each period's budget/spend/signed variance per (managing_agency, fms_id) line, the line-keyed fms_project_name, + the adopted original budget when recorded (adoption-only lines return header-only). Provide exactly one of pid/fms_id; managing_agency scopes a multi-agency FMS id to one line — otherwise ALL lines are listed.

Interpretation rules:

  • [relationships] "Project" is ambiguous: PID identifies a SCHEDULE; FMS ID identifies a BUDGET. They are MANY-TO-MANY: a budget can fund several PIDs and a PID can have several budgets. LIST ALL linked counterparts; never silently select one. One linked counterpart does not establish a 1:1 relationship in the reverse direction. A budget without a PID is normal before Design and for lines that do not require schedules; absence alone does not establish missing data. Source-only schedules can also lack dashboard funding links.

  • [grain] Schedule questions use PID; budget questions use the BUDGET LINE key (managing_agency, fms_id). The same FMS ID under different holders is distinct lines. Schedule history is PID x reporting_period; budget history is budget line x reporting_period; fiscal-year budgets also key on fiscal_year. The schedule source has no fms_id; budget sources have no pid. The combined source repeats rows across PID-budget links and location splits: deduplicate at the requested entity grain before counting or summing. Never compare budgets using fms_id alone.

  • [population] Listings/rankings default to population_scope='latest_known' (each entity's own latest observation). Use population_scope='current' for the selected complete snapshot. State the population_scope and observation period; respect present_in_current_snapshot. Detail tools use latest-known state and each anchor's latest available link period; these links are not proof of presence in the current complete snapshot.

  • [budget_baseline] budget_variance is change from the previous reporting period; cumulative_budget_change is latest minus original. State which basis is used. original_budget prefers the adopted first budget, with first_snapshot as fallback: disclose original_budget_source. Adoption months are calendar months from a separate first-budget system, not reporting snapshots.

  • [signed_values] Report neutral, SIGNED changes: "moved 45 days later" or "budget decreased $2M". Do not echo loaded terms in the answer. "slippage" means positive schedule change and "overrun" means positive budget growth; neither includes the decreasing side. Preserve the returned direction and metric basis.

  • [schedule_coverage] Schedule totals and cumulative variance use dashboard-aligned schedule_history. source_schedule_history retains native observations absent from that population; schedule_source_coverage reconciles them. State the schedule universe and cumulative basis. Parenthesized phases are no-schedule reasons. Respect excluded variance artifacts and missing/invalid-duration counts; forward duration statistics exclude reversed dates.

  • [lifecycle] Lifecycle: Pre-Design -> Design -> Construction Procurement -> Construction -> Close-out. Schedule progression is reported from Design through Construction. Forecasts and most actual milestones can be suppressed outside those phases; actual_construction_end is the exception and means substantial completion. NULL milestones need not mean missing data. Budget spend%=100 does not prove completion. forecast_past_due is evaluated as of the observation period, not today's date.

Inputs: pid, fms_id, managing_agency. Returns: lines, anchor, periods, provenance, +1 more

get_project_scheduleA
Read-onlyIdempotent

Schedule (PID): phase, lifecycle, signed variance, reason; lists linked budgets; forecast_past_due flags a forecast already past as of the PID's own latest report (never true for completed/cancelled).

Interpretation rules:

  • [relationships] "Project" is ambiguous: PID identifies a SCHEDULE; FMS ID identifies a BUDGET. They are MANY-TO-MANY: a budget can fund several PIDs and a PID can have several budgets. LIST ALL linked counterparts; never silently select one. One linked counterpart does not establish a 1:1 relationship in the reverse direction. A budget without a PID is normal before Design and for lines that do not require schedules; absence alone does not establish missing data. Source-only schedules can also lack dashboard funding links.

  • [population] Listings/rankings default to population_scope='latest_known' (each entity's own latest observation). Use population_scope='current' for the selected complete snapshot. State the population_scope and observation period; respect present_in_current_snapshot. Detail tools use latest-known state and each anchor's latest available link period; these links are not proof of presence in the current complete snapshot.

  • [lifecycle] Lifecycle: Pre-Design -> Design -> Construction Procurement -> Construction -> Close-out. Schedule progression is reported from Design through Construction. Forecasts and most actual milestones can be suppressed outside those phases; actual_construction_end is the exception and means substantial completion. NULL milestones need not mean missing data. Budget spend%=100 does not prove completion. forecast_past_due is evaluated as of the observation period, not today's date.

  • [funding_totals] attributed_budget counts a funding line fully on every PID it funds; it is not an allocated share or an independent project cost. Summing it across PIDs can double-count shared funding. For the portfolio's distinct funding total use summary.line_budget_total, which counts each (managing_agency, fms_id) once. State which budget basis is reported.

  • [signed_values] Report neutral, SIGNED changes: "moved 45 days later" or "budget decreased $2M". Do not echo loaded terms in the answer. "slippage" means positive schedule change and "overrun" means positive budget growth; neither includes the decreasing side. Preserve the returned direction and metric basis.

  • [schedule_coverage] Schedule totals and cumulative variance use dashboard-aligned schedule_history. source_schedule_history retains native observations absent from that population; schedule_source_coverage reconciles them. State the schedule universe and cumulative basis. Parenthesized phases are no-schedule reasons. Respect excluded variance artifacts and missing/invalid-duration counts; forward duration statistics exclude reversed dates.

  • [location] Location belongs to the BUDGET LINE, represented by fms_location. A PID inherits its funding-line boroughs: one specific borough takes precedence over Citywide, multiple specific boroughs yield 'Multiple', and only Citywide lines yield 'Citywide'. Preserve the boroughs list when several boroughs apply.

Inputs: pid (required). Returns: answer, provenance, linked_budgets, interpretation_rules

list_agenciesC
Read-onlyIdempotent

Agency dictionary with live CPD presence + schedule-executor flag.

Interpretation rules:

  • [agency_roles] Agency attribution is role-aware: an agency's projects mean its sponsor (owner) view, except DDC/DCAS/EDC default to managing (builder). State the returned agency_scope. managing_agency is the executor on schedules and the budget-holder on budgets; a budget-only holder is not a schedule executor. list_agencies exposes is_schedule_executor. For sponsor-scoped budget totals, use a semi-join to fms_sponsor; a value-bearing join can multiply lines. Co-owner totals can overlap and must not be added together.

  • [presence] Presence in a selected reporting snapshot means reportable at that period. There is no separate active flag. Historical presence or a latest-known row does not prove presence in the current complete snapshot. A completed project can retain an open budget line for years; presence does not mean construction is in progress.

Inputs: contains. Returns: agencies, provenance, interpretation_rules

list_categoriesA
Read-onlyIdempotent

Program/facility categories (Library, Parks & Recreation, Sewer & Water, …) with budget-line counts and total budget. Use a category name as the category filter on rank_projects. Categories are derived from ten_year_plan_category + sponsor_agency + fms-id prefix — NOT managing_agency or project name.

Interpretation rules:

  • [categories] Classify with the curated category_dim, not project-name searches: specific ten-year labels/FMS prefixes precede sponsor routing, then generic facility keywords and Other. Categories key on (managing_agency, fms_id); institution owner rules can use all-history ownership. Schedule category_scope='current' uses each PID's current funding links; 'all_history' includes former links. A PID can count in multiple categories, so schedule category counts are non-additive; each budget line has one category.

  • [grain] Schedule questions use PID; budget questions use the BUDGET LINE key (managing_agency, fms_id). The same FMS ID under different holders is distinct lines. Schedule history is PID x reporting_period; budget history is budget line x reporting_period; fiscal-year budgets also key on fiscal_year. The schedule source has no fms_id; budget sources have no pid. The combined source repeats rows across PID-budget links and location splits: deduplicate at the requested entity grain before counting or summing. Never compare budgets using fms_id alone.

  • [period_basis] Reporting-period basis: state the returned period for every count, total or ranking and both periods for comparisons. Period aggregates default to the latest complete snapshot, which may precede a partially published newer period. fms_location, fms_sponsor and lifetime_budget_variance are all-history dimensions without reporting_period: use them for enrichment or lifetime figures, never as a single period's inventory.

Inputs: no named parameters. Returns: period, categories, provenance, interpretation_rules

project_duration_statsA
Read-onlyIdempotent

Duration distribution between two ACTUAL milestones (requires both dates). Only forward actual_design_start to actual_construction_end is supported. Negative intervals are retained in invalid_intervals and excluded from statistics; missing-date and invalid-order counts reconcile to the full latest-known population. Optional group_by returns per-group stats instead of the citywide block.

Interpretation rules:

  • [lifecycle] Lifecycle: Pre-Design -> Design -> Construction Procurement -> Construction -> Close-out. Schedule progression is reported from Design through Construction. Forecasts and most actual milestones can be suppressed outside those phases; actual_construction_end is the exception and means substantial completion. NULL milestones need not mean missing data. Budget spend%=100 does not prove completion. forecast_past_due is evaluated as of the observation period, not today's date.

  • [schedule_coverage] Schedule totals and cumulative variance use dashboard-aligned schedule_history. source_schedule_history retains native observations absent from that population; schedule_source_coverage reconciles them. State the schedule universe and cumulative basis. Parenthesized phases are no-schedule reasons. Respect excluded variance artifacts and missing/invalid-duration counts; forward duration statistics exclude reversed dates.

  • [population] Listings/rankings default to population_scope='latest_known' (each entity's own latest observation). Use population_scope='current' for the selected complete snapshot. State the population_scope and observation period; respect present_in_current_snapshot. Detail tools use latest-known state and each anchor's latest available link period; these links are not proof of presence in the current complete snapshot.

Inputs: group_by, to_milestone, from_milestone. Returns: stats, groups, n_projects, provenance, +2 more

project_portfolioA
Read-onlyIdempotent

Cross-section listing of projects (PIDs): filter by category (see list_categories), borough, community_board, lifecycle_status ('in_progress'|'completed'|'cancelled'), and/or agency (+agency_role lens); rows ordered by nearest completion date (NULLs last). Each row carries schedule state + attributed_budget; summary covers the FULL filtered set and reports BOTH budget bases (per-PID attributed vs deduped line_budget_total). Borough matches the PID's boroughs LIST, so multi-borough projects are found by any of their boroughs. Rows carry forecast_past_due — a forecast already past as of the observation period (never true for completed/cancelled). population_scope 'latest_known' (default) uses each PID's own latest row; 'current' uses values at the selected complete snapshot. Rows expose reporting_period and current-snapshot presence. category_scope 'current' uses current links; 'all_history' includes former category links.

Interpretation rules:

  • [relationships] "Project" is ambiguous: PID identifies a SCHEDULE; FMS ID identifies a BUDGET. They are MANY-TO-MANY: a budget can fund several PIDs and a PID can have several budgets. LIST ALL linked counterparts; never silently select one. One linked counterpart does not establish a 1:1 relationship in the reverse direction. A budget without a PID is normal before Design and for lines that do not require schedules; absence alone does not establish missing data. Source-only schedules can also lack dashboard funding links.

  • [population] Listings/rankings default to population_scope='latest_known' (each entity's own latest observation). Use population_scope='current' for the selected complete snapshot. State the population_scope and observation period; respect present_in_current_snapshot. Detail tools use latest-known state and each anchor's latest available link period; these links are not proof of presence in the current complete snapshot.

  • [presence] Presence in a selected reporting snapshot means reportable at that period. There is no separate active flag. Historical presence or a latest-known row does not prove presence in the current complete snapshot. A completed project can retain an open budget line for years; presence does not mean construction is in progress.

  • [agency_roles] Agency attribution is role-aware: an agency's projects mean its sponsor (owner) view, except DDC/DCAS/EDC default to managing (builder). State the returned agency_scope. managing_agency is the executor on schedules and the budget-holder on budgets; a budget-only holder is not a schedule executor. list_agencies exposes is_schedule_executor. For sponsor-scoped budget totals, use a semi-join to fms_sponsor; a value-bearing join can multiply lines. Co-owner totals can overlap and must not be added together.

  • [categories] Classify with the curated category_dim, not project-name searches: specific ten-year labels/FMS prefixes precede sponsor routing, then generic facility keywords and Other. Categories key on (managing_agency, fms_id); institution owner rules can use all-history ownership. Schedule category_scope='current' uses each PID's current funding links; 'all_history' includes former links. A PID can count in multiple categories, so schedule category counts are non-additive; each budget line has one category.

  • [funding_totals] attributed_budget counts a funding line fully on every PID it funds; it is not an allocated share or an independent project cost. Summing it across PIDs can double-count shared funding. For the portfolio's distinct funding total use summary.line_budget_total, which counts each (managing_agency, fms_id) once. State which budget basis is reported.

  • [lifecycle] Lifecycle: Pre-Design -> Design -> Construction Procurement -> Construction -> Close-out. Schedule progression is reported from Design through Construction. Forecasts and most actual milestones can be suppressed outside those phases; actual_construction_end is the exception and means substantial completion. NULL milestones need not mean missing data. Budget spend%=100 does not prove completion. forecast_past_due is evaluated as of the observation period, not today's date.

  • [location] Location belongs to the BUDGET LINE, represented by fms_location. A PID inherits its funding-line boroughs: one specific borough takes precedence over Citywide, multiple specific boroughs yield 'Multiple', and only Citywide lines yield 'Citywide'. Preserve the boroughs list when several boroughs apply.

  • [signed_values] Report neutral, SIGNED changes: "moved 45 days later" or "budget decreased $2M". Do not echo loaded terms in the answer. "slippage" means positive schedule change and "overrun" means positive budget growth; neither includes the decreasing side. Preserve the returned direction and metric basis.

  • [schedule_coverage] Schedule totals and cumulative variance use dashboard-aligned schedule_history. source_schedule_history retains native observations absent from that population; schedule_source_coverage reconciles them. State the schedule universe and cumulative basis. Parenthesized phases are no-schedule reasons. Respect excluded variance artifacts and missing/invalid-duration counts; forward duration statistics exclude reversed dates.

Inputs: n, agency, borough, category, +5 more. Returns: rows, notes, summary, truncated, +2 more

rank_projectsA
Read-onlyIdempotent

Rank schedules (entity='schedule', rows=PIDs) or budgets (entity='budget', rows=FMS lines). rank_by must be NATIVE to entity; the other domain is filter-only. Echoes ranked_entity. Budget rank_by: total_budget | spend_to_date | spend_pct | budget_variance (last-period delta) | cumulative_budget_change (latest - original budget). Optional category (see list_categories) filters to one program type, e.g. 'Library'. Optional agency scopes to one agency; agency_role ('auto'|'sponsor'|'managing') picks the lens — 'auto' uses the owner (sponsor) view, except DDC/DCAS/EDC default to builder (managing). Echoes agency_scope; schedule rows carry forecast_past_due — a forecast already past as of the observation period (never true for completed/cancelled). population_scope='latest_known' uses each entity's own latest observation; 'current' uses values at the selected complete snapshot. Rows include their reporting_period and current-snapshot presence. category_scope='current' uses current funding links; 'all_history' also matches removed funding links.

Interpretation rules:

  • [relationships] "Project" is ambiguous: PID identifies a SCHEDULE; FMS ID identifies a BUDGET. They are MANY-TO-MANY: a budget can fund several PIDs and a PID can have several budgets. LIST ALL linked counterparts; never silently select one. One linked counterpart does not establish a 1:1 relationship in the reverse direction. A budget without a PID is normal before Design and for lines that do not require schedules; absence alone does not establish missing data. Source-only schedules can also lack dashboard funding links.

  • [grain] Schedule questions use PID; budget questions use the BUDGET LINE key (managing_agency, fms_id). The same FMS ID under different holders is distinct lines. Schedule history is PID x reporting_period; budget history is budget line x reporting_period; fiscal-year budgets also key on fiscal_year. The schedule source has no fms_id; budget sources have no pid. The combined source repeats rows across PID-budget links and location splits: deduplicate at the requested entity grain before counting or summing. Never compare budgets using fms_id alone.

  • [population] Listings/rankings default to population_scope='latest_known' (each entity's own latest observation). Use population_scope='current' for the selected complete snapshot. State the population_scope and observation period; respect present_in_current_snapshot. Detail tools use latest-known state and each anchor's latest available link period; these links are not proof of presence in the current complete snapshot.

  • [presence] Presence in a selected reporting snapshot means reportable at that period. There is no separate active flag. Historical presence or a latest-known row does not prove presence in the current complete snapshot. A completed project can retain an open budget line for years; presence does not mean construction is in progress.

  • [agency_roles] Agency attribution is role-aware: an agency's projects mean its sponsor (owner) view, except DDC/DCAS/EDC default to managing (builder). State the returned agency_scope. managing_agency is the executor on schedules and the budget-holder on budgets; a budget-only holder is not a schedule executor. list_agencies exposes is_schedule_executor. For sponsor-scoped budget totals, use a semi-join to fms_sponsor; a value-bearing join can multiply lines. Co-owner totals can overlap and must not be added together.

  • [categories] Classify with the curated category_dim, not project-name searches: specific ten-year labels/FMS prefixes precede sponsor routing, then generic facility keywords and Other. Categories key on (managing_agency, fms_id); institution owner rules can use all-history ownership. Schedule category_scope='current' uses each PID's current funding links; 'all_history' includes former links. A PID can count in multiple categories, so schedule category counts are non-additive; each budget line has one category.

  • [funding_totals] attributed_budget counts a funding line fully on every PID it funds; it is not an allocated share or an independent project cost. Summing it across PIDs can double-count shared funding. For the portfolio's distinct funding total use summary.line_budget_total, which counts each (managing_agency, fms_id) once. State which budget basis is reported.

  • [budget_baseline] budget_variance is change from the previous reporting period; cumulative_budget_change is latest minus original. State which basis is used. original_budget prefers the adopted first budget, with first_snapshot as fallback: disclose original_budget_source. Adoption months are calendar months from a separate first-budget system, not reporting snapshots.

  • [signed_values] Report neutral, SIGNED changes: "moved 45 days later" or "budget decreased $2M". Do not echo loaded terms in the answer. "slippage" means positive schedule change and "overrun" means positive budget growth; neither includes the decreasing side. Preserve the returned direction and metric basis.

  • [schedule_coverage] Schedule totals and cumulative variance use dashboard-aligned schedule_history. source_schedule_history retains native observations absent from that population; schedule_source_coverage reconciles them. State the schedule universe and cumulative basis. Parenthesized phases are no-schedule reasons. Respect excluded variance artifacts and missing/invalid-duration counts; forward duration statistics exclude reversed dates.

  • [lifecycle] Lifecycle: Pre-Design -> Design -> Construction Procurement -> Construction -> Close-out. Schedule progression is reported from Design through Construction. Forecasts and most actual milestones can be suppressed outside those phases; actual_construction_end is the exception and means substantial completion. NULL milestones need not mean missing data. Budget spend%=100 does not prove completion. forecast_past_due is evaluated as of the observation period, not today's date.

Inputs: entity (required), rank_by (required), n, agency, +8 more. Returns: rows, label, rank_by, provenance, +2 more

resolve_project_referenceA
Read-onlyIdempotent

Resolve any project identifier (PID, FMS ID, name, partial) → schedule+budget matches bucketed by entity. Call this first for any named-project question.

Interpretation rules:

  • [resolution] Call resolve_project_reference first for named-project questions. Matches identify candidate entities, not funding relationships: inspect linked_budgets/linked_schedules in the detail tools. Preserve multiple candidates rather than silently selecting one. Follow pagination next_offset when more matches are needed; disclose truncation when reporting an incomplete list.

  • [relationships] "Project" is ambiguous: PID identifies a SCHEDULE; FMS ID identifies a BUDGET. They are MANY-TO-MANY: a budget can fund several PIDs and a PID can have several budgets. LIST ALL linked counterparts; never silently select one. One linked counterpart does not establish a 1:1 relationship in the reverse direction. A budget without a PID is normal before Design and for lines that do not require schedules; absence alone does not establish missing data. Source-only schedules can also lack dashboard funding links.

  • [grain] Schedule questions use PID; budget questions use the BUDGET LINE key (managing_agency, fms_id). The same FMS ID under different holders is distinct lines. Schedule history is PID x reporting_period; budget history is budget line x reporting_period; fiscal-year budgets also key on fiscal_year. The schedule source has no fms_id; budget sources have no pid. The combined source repeats rows across PID-budget links and location splits: deduplicate at the requested entity grain before counting or summing. Never compare budgets using fms_id alone.

  • [presence] Presence in a selected reporting snapshot means reportable at that period. There is no separate active flag. Historical presence or a latest-known row does not prove presence in the current complete snapshot. A completed project can retain an open budget line for years; presence does not mean construction is in progress.

Inputs: query (required), limit, offset. Returns: provenance, budget_matches, schedule_matches, interpretation_rules

run_sqlA

Run a read-only SELECT against the local CPD DuckDB.

output: 'inline' (default, rows capped) | 'csv' | 'xlsx' (writes a file, returns path).
PREFER the typed tables: latest_project_state (1 row/PID, borough+boroughs,
attributed_budget), schedule_history (PID x period), budget_history (snapshot rows
at the (fms_id, managing_agency) x period grain), original_budget (adopted first
budgets), lifetime_budget_variance (per-line lifetime, original_budget_source),
schedule_budget_link (PID<->FMS edges), pid_funding (per-PID link rollup),
cumulative_schedule_variance (per-PID lifetime days), fms_sponsor (fms_id -> owner),
fms_location (line-level borough/community board/name), agency_rollup_by_period,
category_dim, agency_dim, project_budget_fy, meta, data_build,
source_schedule_history (95tx-native observations, in_dashboard flag),
schedule_source_coverage (PID-level reconciliation and both cumulative bases).
RAW mirrors (raw_project_detail, raw_budget_fy, raw_budget_history,
raw_schedule_history) are all VARCHAR. Inline results echo latest_reporting_period
and may carry period_basis_note and truncation_note.

Interpretation rules:

  • [sql_usage] Prefer purpose-built tools for supported questions. For custom SQL, use describe_table for grain/keying and describe_field for field definitions, then prefer typed tables. Raw mirrors are VARCHAR and need casts. run_sql enforces read-only access, not correct analytical grain: the caller must prevent join fan-out and choose the period/population. Disclose truncated results; use CSV/XLSX for the full result when needed.

  • [relationships] "Project" is ambiguous: PID identifies a SCHEDULE; FMS ID identifies a BUDGET. They are MANY-TO-MANY: a budget can fund several PIDs and a PID can have several budgets. LIST ALL linked counterparts; never silently select one. One linked counterpart does not establish a 1:1 relationship in the reverse direction. A budget without a PID is normal before Design and for lines that do not require schedules; absence alone does not establish missing data. Source-only schedules can also lack dashboard funding links.

  • [grain] Schedule questions use PID; budget questions use the BUDGET LINE key (managing_agency, fms_id). The same FMS ID under different holders is distinct lines. Schedule history is PID x reporting_period; budget history is budget line x reporting_period; fiscal-year budgets also key on fiscal_year. The schedule source has no fms_id; budget sources have no pid. The combined source repeats rows across PID-budget links and location splits: deduplicate at the requested entity grain before counting or summing. Never compare budgets using fms_id alone.

  • [period_basis] Reporting-period basis: state the returned period for every count, total or ranking and both periods for comparisons. Period aggregates default to the latest complete snapshot, which may precede a partially published newer period. fms_location, fms_sponsor and lifetime_budget_variance are all-history dimensions without reporting_period: use them for enrichment or lifetime figures, never as a single period's inventory.

  • [population] Listings/rankings default to population_scope='latest_known' (each entity's own latest observation). Use population_scope='current' for the selected complete snapshot. State the population_scope and observation period; respect present_in_current_snapshot. Detail tools use latest-known state and each anchor's latest available link period; these links are not proof of presence in the current complete snapshot.

  • [agency_roles] Agency attribution is role-aware: an agency's projects mean its sponsor (owner) view, except DDC/DCAS/EDC default to managing (builder). State the returned agency_scope. managing_agency is the executor on schedules and the budget-holder on budgets; a budget-only holder is not a schedule executor. list_agencies exposes is_schedule_executor. For sponsor-scoped budget totals, use a semi-join to fms_sponsor; a value-bearing join can multiply lines. Co-owner totals can overlap and must not be added together.

  • [categories] Classify with the curated category_dim, not project-name searches: specific ten-year labels/FMS prefixes precede sponsor routing, then generic facility keywords and Other. Categories key on (managing_agency, fms_id); institution owner rules can use all-history ownership. Schedule category_scope='current' uses each PID's current funding links; 'all_history' includes former links. A PID can count in multiple categories, so schedule category counts are non-additive; each budget line has one category.

  • [funding_totals] attributed_budget counts a funding line fully on every PID it funds; it is not an allocated share or an independent project cost. Summing it across PIDs can double-count shared funding. For the portfolio's distinct funding total use summary.line_budget_total, which counts each (managing_agency, fms_id) once. State which budget basis is reported.

  • [budget_baseline] budget_variance is change from the previous reporting period; cumulative_budget_change is latest minus original. State which basis is used. original_budget prefers the adopted first budget, with first_snapshot as fallback: disclose original_budget_source. Adoption months are calendar months from a separate first-budget system, not reporting snapshots.

  • [schedule_coverage] Schedule totals and cumulative variance use dashboard-aligned schedule_history. source_schedule_history retains native observations absent from that population; schedule_source_coverage reconciles them. State the schedule universe and cumulative basis. Parenthesized phases are no-schedule reasons. Respect excluded variance artifacts and missing/invalid-duration counts; forward duration statistics exclude reversed dates.

  • [signed_values] Report neutral, SIGNED changes: "moved 45 days later" or "budget decreased $2M". Do not echo loaded terms in the answer. "slippage" means positive schedule change and "overrun" means positive budget growth; neither includes the decreasing side. Preserve the returned direction and metric basis.

  • [lifecycle] Lifecycle: Pre-Design -> Design -> Construction Procurement -> Construction -> Close-out. Schedule progression is reported from Design through Construction. Forecasts and most actual milestones can be suppressed outside those phases; actual_construction_end is the exception and means substantial completion. NULL milestones need not mean missing data. Budget spend%=100 does not prove completion. forecast_past_due is evaluated as of the observation period, not today's date.

  • [location] Location belongs to the BUDGET LINE, represented by fms_location. A PID inherits its funding-line boroughs: one specific borough takes precedence over Citywide, multiple specific boroughs yield 'Multiple', and only Citywide lines yield 'Citywide'. Preserve the boroughs list when several boroughs apply.

  • [presence] Presence in a selected reporting snapshot means reportable at that period. There is no separate active flag. Historical presence or a latest-known row does not prove presence in the current complete snapshot. A completed project can retain an open budget line for years; presence does not mean construction is in progress.

Inputs: query (required), output. Returns: file, rows, truncated, provenance, +1 more

schedule_breakdownA
Read-onlyIdempotent

Counts/averages of schedule metrics by agency/sponsor/borough/phase/category. agency scopes to one agency; agency_role ('auto'|'sponsor'|'managing') picks owner vs builder lens (auto: sponsor, except DDC/DCAS/EDC -> managing). Category grouping counts a PID once in EACH of its categories (non-additive). Report neutral, signed variance.

Interpretation rules:

  • [grain] Schedule questions use PID; budget questions use the BUDGET LINE key (managing_agency, fms_id). The same FMS ID under different holders is distinct lines. Schedule history is PID x reporting_period; budget history is budget line x reporting_period; fiscal-year budgets also key on fiscal_year. The schedule source has no fms_id; budget sources have no pid. The combined source repeats rows across PID-budget links and location splits: deduplicate at the requested entity grain before counting or summing. Never compare budgets using fms_id alone.

  • [period_basis] Reporting-period basis: state the returned period for every count, total or ranking and both periods for comparisons. Period aggregates default to the latest complete snapshot, which may precede a partially published newer period. fms_location, fms_sponsor and lifetime_budget_variance are all-history dimensions without reporting_period: use them for enrichment or lifetime figures, never as a single period's inventory.

  • [agency_roles] Agency attribution is role-aware: an agency's projects mean its sponsor (owner) view, except DDC/DCAS/EDC default to managing (builder). State the returned agency_scope. managing_agency is the executor on schedules and the budget-holder on budgets; a budget-only holder is not a schedule executor. list_agencies exposes is_schedule_executor. For sponsor-scoped budget totals, use a semi-join to fms_sponsor; a value-bearing join can multiply lines. Co-owner totals can overlap and must not be added together.

  • [categories] Classify with the curated category_dim, not project-name searches: specific ten-year labels/FMS prefixes precede sponsor routing, then generic facility keywords and Other. Categories key on (managing_agency, fms_id); institution owner rules can use all-history ownership. Schedule category_scope='current' uses each PID's current funding links; 'all_history' includes former links. A PID can count in multiple categories, so schedule category counts are non-additive; each budget line has one category.

  • [signed_values] Report neutral, SIGNED changes: "moved 45 days later" or "budget decreased $2M". Do not echo loaded terms in the answer. "slippage" means positive schedule change and "overrun" means positive budget growth; neither includes the decreasing side. Preserve the returned direction and metric basis.

  • [schedule_coverage] Schedule totals and cumulative variance use dashboard-aligned schedule_history. source_schedule_history retains native observations absent from that population; schedule_source_coverage reconciles them. State the schedule universe and cumulative basis. Parenthesized phases are no-schedule reasons. Respect excluded variance artifacts and missing/invalid-duration counts; forward duration statistics exclude reversed dates.

  • [presence] Presence in a selected reporting snapshot means reportable at that period. There is no separate active flag. Historical presence or a latest-known row does not prove presence in the current complete snapshot. A completed project can retain an open budget line for years; presence does not mean construction is in progress.

Inputs: group_by (required), agency, metric, period, +2 more. Returns: groups, metric, period, provenance, +1 more

schedule_changesC
Read-onlyIdempotent

Newly completed (DR1) or newly delayed projects between two periods. agency scopes to one agency; agency_role ('auto'|'sponsor'|'managing') picks owner vs builder lens.

Interpretation rules:

  • [period_basis] Reporting-period basis: state the returned period for every count, total or ranking and both periods for comparisons. Period aggregates default to the latest complete snapshot, which may precede a partially published newer period. fms_location, fms_sponsor and lifetime_budget_variance are all-history dimensions without reporting_period: use them for enrichment or lifetime figures, never as a single period's inventory.

  • [signed_values] Report neutral, SIGNED changes: "moved 45 days later" or "budget decreased $2M". Do not echo loaded terms in the answer. "slippage" means positive schedule change and "overrun" means positive budget growth; neither includes the decreasing side. Preserve the returned direction and metric basis.

  • [schedule_coverage] Schedule totals and cumulative variance use dashboard-aligned schedule_history. source_schedule_history retains native observations absent from that population; schedule_source_coverage reconciles them. State the schedule universe and cumulative basis. Parenthesized phases are no-schedule reasons. Respect excluded variance artifacts and missing/invalid-duration counts; forward duration statistics exclude reversed dates.

  • [lifecycle] Lifecycle: Pre-Design -> Design -> Construction Procurement -> Construction -> Close-out. Schedule progression is reported from Design through Construction. Forecasts and most actual milestones can be suppressed outside those phases; actual_construction_end is the exception and means substantial completion. NULL milestones need not mean missing data. Budget spend%=100 does not prove completion. forecast_past_due is evaluated as of the observation period, not today's date.

  • [agency_roles] Agency attribution is role-aware: an agency's projects mean its sponsor (owner) view, except DDC/DCAS/EDC default to managing (builder). State the returned agency_scope. managing_agency is the executor on schedules and the budget-holder on budgets; a budget-only holder is not a schedule executor. list_agencies exposes is_schedule_executor. For sponsor-scoped budget totals, use a semi-join to fms_sponsor; a value-bearing join can multiply lines. Co-owner totals can overlap and must not be added together.

Inputs: to_period (required), change_type (required), from_period (required), agency, +2 more. Returns: changes, provenance, interpretation_rules

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 18 tools

    Disambiguation4/5

    Tools are cleanly split by domain (schedule vs budget) and by function (detail, history, breakdown, change, duration), so most purposes are distinct. There is mild overlap between rank_projects and project_portfolio (both listing/filtering entities) and between the breakdown/rank tools for aggregate cuts, but the descriptions disambiguate these well enough.

    Naming Consistency4/5

    Names are consistently snake_case throughout. The only deviation is stylistic: some use verb_noun (get_project_schedule, list_agencies, resolve_project_reference, rank_projects) while others are noun-based (schedule_breakdown, dataset_info, project_portfolio), but this remains predictable and readable.

    Tool Count4/5

    18 tools is slightly heavy but justified for a rich analytical domain spanning schedule and budget lenses with detail, history, change, duration, and aggregate operations. Each tool appears to earn its place, with run_sql serving as the general escape hatch.

    Completeness5/5

    The surface covers the full read-only analytical lifecycle: resolution, entity detail, per-period history, breakdowns, period-over-period changes, duration statistics, portfolio listing, rankings, dictionaries, schema/field introspection, and an arbitrary SQL fallback. No obvious gaps for a read-only open-data server.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to query NYC public records through a hosted MCP server, supporting civic workflows such as property research, business evaluation, public money tracking, and influence mapping.
      10 npm
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to query live construction project data such as RFIs, submittals, budget variance, daily logs, punch lists, and inspection checklists.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients such as Claude, Copilot and IDE agents to interrogate a building's digital twin in plain language through seven tools covering building overview, room lists, per-room design promises, diagnosed findings, room time series, sandboxed read-only SQL and BCF issue export. Answers whether each room still meets its own design intent — and why not — instead of relying on fixed thresholds.
      MIT