Skip to main content
Glama
WillHsiaoNYC

NYC Open Data Capital Projects MCP Server

by WillHsiaoNYC

budget_breakdown

Read-onlyIdempotent

Break down NYC capital project total budget or spend by managing agency or category, with optional agency scope and role-aware attribution.

Instructions

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agencyNo
metricNototal_budget
periodNocurrent
group_byNomanaging_agency
agency_roleNoauto

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
groupsYes
metricYes
periodYes
provenanceYes
interpretation_rulesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.1.1
    • addedInput schema / properties / agency_role / enum
      Added value: +[
      +  "auto",
      +  "sponsor",
      +  "managing"
      +]
    • addedInput schema / properties / group_by / enum
      Added value: +[
      +  "managing_agency",
      +  "category"
      +]
    • addedInput schema / properties / metric / enum
      Added value: +[
      +  "total_budget",
      +  "spend"
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "InterpretationRule": {
      +      "properties": {
      +        "id": {
      +          "description": "Stable identifier of the domain rule.",
      +          "title": "Id",
      +          "type": "string"
      +        },
      +        "text": {
      +          "description": "Guidance for interpreting and reporting this tool's result.",
      +          "title": "Text",
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "id",
      +        "text"
      +      ],
      +      "title": "InterpretationRule",
      +      "type": "object"
      +    }
      +  },
      +  "additionalProperties": true,
      +  "properties": {
      +    "groups": {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "title": "Groups",
      +      "type": "array"
      +    },
      +    "interpretation_rules": {
      +      "items": {
      +        "$ref": "#/$defs/InterpretationRule"
      +      },
      +      "title": "Interpretation Rules",
      +      "type": "array"
      +    },
      +    "metric": {
      +      "title": "Metric",
      +      "type": "string"
      +    },
      +    "period": {
      +      "title": "Period",
      +      "type": "string"
      +    },
      +    "provenance": {
      +      "additionalProperties": true,
      +      "title": "Provenance",
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "provenance",
      +    "interpretation_rules",
      +    "groups",
      +    "period",
      +    "metric"
      +  ],
      +  "title": "BreakdownResult",
      +  "type": "object"
      +}
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already cover read-only/idempotent safety, and the description adds substantial behavior the annotations cannot: dedup requirements, non-additive category counts, the latest-complete-snapshot default for periods, and role-aware agency attribution. These are exactly the traits that prevent miscounting.

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

Conciseness3/5

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

The first sentence is tightly front-loaded and earns its place, but the 'Interpretation rules' block is a dense wall of text that folds in cross-cutting grain, schedule/PID, and category rules beyond this tool's core scope. Useful, but oversized and hard to parse at a glance.

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?

An output schema exists, so return formatting need not be described, and the remaining complexity (grain, dedup, roles, period basis, categories) is thoroughly addressed. An agent has enough to call and correctly interpret the result.

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

Parameters4/5

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

With 0% schema coverage the description carries the burden, and it covers most params: agency ('scopes to one agency'), agency_role ('owner vs builder lens'), group_by ('by managing_agency or category'), and period via the period_basis rules. metric's two values (total_budget/spend) are only implied by the opening wording rather than defined, so full compensation is slightly incomplete.

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

Purpose4/5

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

The opening sentence states a specific verb+resource ('Total budget / spend by managing_agency or category, deduped on (fms_id, managing_agency)') and even names the grouping grain, so an agent knows exactly what it returns. It routes to run_sql for richer cuts, but does not explicitly distinguish itself from the sibling schedule_breakdown, which the near-identical name makes risky.

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

Usage Guidelines5/5

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

It gives explicit alternative routing ('For richer cuts use run_sql') and clear when-not guidance ('fms_location, fms_sponsor and lifetime_budget_variance... use them for enrichment or lifetime figures, never as a single period's inventory'). It also states which lens to pick via agency_role and the semi-join rule for sponsor-scoped totals, leaving little to inference.

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