Skip to main content
Glama
WillHsiaoNYC

NYC Open Data Capital Projects MCP Server

by WillHsiaoNYC

run_sql

Execute read-only SQL queries to analyze NYC capital project schedule, budget, and lifecycle data. Query typed tables with domain rules for accurate project and funding insights.

Instructions

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), agency_rollup_by_period,
category_dim, agency_dim, project_budget_fy, meta.
GRAIN RULES: budget comparisons key on (managing_agency, fms_id) — never fms_id
alone; sponsor-scoped budget sums use the semi-join
fms_id IN (SELECT fms_id FROM fms_sponsor WHERE sponsor_agency = ...) — a
value-bearing JOIN fans out across a line's agency rows and double-counts.
PERIOD BASIS: fms_location, fms_sponsor, lifetime_budget_variance are ALL-HISTORY
dimensions (latest row per line/owner, NO reporting_period column) — JOIN them to
enrich or for lifetime figures; do NOT COUNT them as a single period's inventory.
For a period count, aggregate raw_project_detail / schedule_history / budget_history
filtered by reporting_period. Every result echoes latest_reporting_period (and warns
via period_basis_note when a query counts an all-history dim) — state the basis.
RAW mirrors (raw_project_detail, raw_budget_fy, raw_budget_history,
raw_schedule_history) are all VARCHAR — cast as needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
outputNoinline
Behavior5/5

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

With no annotations provided, the description fully discloses behaviors: read-only nature, output options with row caps and file writing, grain rules, and data type notes (VARCHAR). No contradictions.

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

Conciseness4/5

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

The description is front-loaded with the main purpose and well-structured, but it is lengthy. Most sentences add value, but some detail could be condensed.

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

Completeness5/5

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

Given the complexity of a SQL tool with many tables, the description provides comprehensive context: table list, grain rules, period basis, and output options. It is complete for an agent to use correctly.

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

Parameters4/5

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

The description adds meaning to the output parameter (inline/csv/xlsx) but does not describe the query parameter format or constraints. Given 0% schema coverage, the description compensates partially.

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

Purpose5/5

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

The description clearly states it runs a read-only SELECT against a specific database. It distinguishes from sibling tools by being a general SQL interface, while siblings are specific analyses.

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

Usage Guidelines4/5

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

The description provides extensive usage guidance, including preferred tables, grain rules, period basis, and output options. However, it does not explicitly compare to alternative tools or state when not to use this tool.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/WillHsiaoNYC/NYC-Opendata-Capital-Projects-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server