/** * Tool registration for the NYC Checkbook MCP server. * * Zod schemas here are the single source of truth for each tool's input * schema — the SDK's McpServer converts them to JSON Schema for tools/list. * * The domain contracts (criteria names, response columns, required-field * rules, and the smart_search availability handling) match the live * CheckbookNYC API as verified in PR #4 (2026-07-06): the Budget year * criterion is "year" (not "fiscal_year"); payroll exposes no employee-name * fields; smart_search returns a structured unavailability result when the * WAF/JS-rendered web endpoint is unusable server-side. */ import { z } from "zod"; import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; import { type Criteria, type DataDomain } from "./checkbook.js"; /** Map of input field name → API criteria name, applied for truthy values. */ export declare function valueCriteria(input: Record, map: Record): Criteria[]; /** Build a range criterion if either bound is provided; missing bounds get defaults. */ export declare function rangeCriterion(name: string, start: string | number | undefined, end: string | number | undefined, defaultStart: string, defaultEnd: string): Criteria | undefined; export declare const MAX_RECORDS_PER_CALL = 20000; export declare function runSearch(domain: DataDomain, columns: string[], criteria: Criteria[], page: number, page_size: number, extra?: Record): Promise; /** * Guidance returned when a caller filters contracts by vendor *name*. * * The Checkbook NYC contracts XML API has no vendor-name request parameter and * no vendor-directory domain to resolve a name → vendor_code (verified against * the API config: only budget/contracts/payroll/revenue/spending domains * exist). Rather than silently drop the filter (which would return unrelated * contracts) or send an invalid param (which yields an opaque 1101 error), the * handler stops and explains the supported paths. */ export declare const VENDOR_NAME_UNSUPPORTED_MESSAGE: string; /** * Build a tool inputSchema that REJECTS unknown keys instead of stripping them. * * zod strips unknown keys by default, so an invented parameter vanished silently * and the tool answered a different question with real, correctly formatted data * — undetectable by the calling model. `.strict()` makes it a parse error, which * the SDK raises before the handler runs. Passing a full ZodObject (rather than a * raw shape) is supported: the SDK's getZodSchemaObject returns a schema instance * unchanged and only wraps bare raw shapes. * * `aliases` maps a guess we have actually observed to guidance naming the real * parameter, so the caller lands on the fix rather than a bare unrecognized-key error. */ export declare function strictSchema(shape: T, aliases?: Record): z.ZodObject, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>; export interface ContractsSearchInput { status: "registered" | "pending"; category: "expense" | "revenue" | "all"; fiscal_year?: string; agency_code?: string; vendor_name?: string; vendor_code?: string; contract_id?: string; amount_min?: number; amount_max?: number; start_date_from?: string; start_date_to?: string; end_date_from?: string; end_date_to?: string; award_method?: string; mwbe_category?: string; industry?: string; contract_type?: string; purpose?: string; pin?: string; registration_date_from?: string; registration_date_to?: string; contract_includes_sub_vendors?: number; received_date_from?: string; received_date_to?: string; include_sub_vendors?: boolean; } export declare const SUB_VENDOR_COLUMNS: string[]; /** * Select the response columns for a contracts search. * * Base set is DEFAULT_COLUMNS.Contracts (registered) or Contracts_pending. * Sub-vendor columns are appended only for registered contracts when * include_sub_vendors is requested — the pending column set uses a different, * incompatible token scheme. */ export declare function contractsColumns(status: "registered" | "pending", includeSubVendors: boolean): string[]; export declare function contractsCriteria(input: ContractsSearchInput): Criteria[]; /** True when the operator has opted into the unsupported smart_search endpoint (issue #25). */ export declare function smartSearchEnabled(): boolean; export declare const SMART_SEARCH_DISABLED_MESSAGE: string; export interface NycedcContractsInput { fiscal_year?: string; vendor_name?: string; contract_id?: string; entity_contract_number?: string; other_government_entities_code?: string; award_method?: string; expense_category?: string; budget_name?: string; commodity_line?: string; pin?: string; amount_min?: number; amount_max?: number; start_date_from?: string; start_date_to?: string; end_date_from?: string; end_date_to?: string; } export declare function nycedcContractsCriteria(input: NycedcContractsInput): Criteria[]; export interface NychaContractsInput { fiscal_year?: string; vendor_name?: string; vendor_code?: string; contract_id?: string; purchase_order_type?: string; responsibility_center?: string; contract_type?: string; award_method?: string; industry?: string; other_government_entities_code?: string; purpose?: string; pin?: string; amount_min?: number; amount_max?: number; start_date_from?: string; start_date_to?: string; end_date_from?: string; end_date_to?: string; approved_date_from?: string; approved_date_to?: string; } export declare function nychaContractsCriteria(input: NychaContractsInput): Criteria[]; export declare function registerTools(server: McpServer): void; //# sourceMappingURL=tools.d.ts.map