Query West Kite's records
queryRead-only SQL over West Kite's records for counts, group-bys, rankings, distance screens and criteria across sales, loans and businesses. One SELECT over the views in the sql field's description, joined on property_id. Replaces summarize_properties and find_underbuilt_sites.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"sql": "<sql>"
},
"name": "query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | One SELECT or WITH ... SELECT over the views above. Read-only SQL over West Kite's records, for questions the screening tools cannot express: several criteria across views (sales, loans, businesses), exact counts and group-bys, rankings by any column, "which of these also ...". Write ONE PostgreSQL SELECT (CTEs allowed) over these views only, joined on property_id: properties (One row per published property (the same records search shows).): property_id uuid, joins every other view; address street address; city city; neighborhood neighborhood when published; state_fips 2-digit state FIPS (smallint); county_fips 5-digit county FIPS text, e.g. '36005' Bronx, '48201' Harris TX, '12105' Polk FL, '13089' DeKalb GA; apn parcel number; property_type Office, Industrial, Retail, Multifamily, Land, Residential, Hospitality, Mixed use, Civic / institutional; subtype publisher use or subtype text; building_sqft building area; lot_sqft lot area; year_built year built; stories stories; units units; zoning zoning code as published; flood_zone FEMA flood zone when published; owner_name owner of record; owner_type approximate class from the owner name: government, nonprofit, trust, llc, corporation, individual; held_years years since the latest transfer; last_sale_date latest transfer date; last_sale_price latest sale price (null where undisclosed, e.g. Texas); market_value assessor market value; assessed_value assessed value; tax_amount annual tax; valuation_year assessment year; nyc_buildable_sqft NYC only: lot area x City of Yes residential FAR with UAP for the primary district; nyc_unused_buildable_sqft NYC only: buildable minus existing building area; longitude longitude; latitude latitude sales (Recorded transfers linked to properties, one row per property per sale.): property_id uuid; sale_id uuid, shared by every parcel of one deal; sale_date date; recording_date date; price deal amount (null when undisclosed); allocated_price this parcel's share when published; transfer_type deed or transfer type as published; qualification qualified/arm's-length flag as published recorded_loans (New York City recorded mortgages and related documents linked to properties. No term or maturity is recorded.): property_id uuid; document_id ACRIS document id; doc_type mortgage, CEMA, assignment, satisfaction...; recorded_on date; document_on date; amount document amount; lender lender name; lender_kind bank, insurer, nonbank, private, government; lot_count lots the document covers businesses (Businesses registered at property addresses (registrations, not proof of current occupancy).): property_id uuid; business_name name; industries text array; website website; suite suite when published; match_state how the address matched Distance: near(p, <lng>, <lat>, <meters>) in WHERE and distance_m(p, <lng>, <lat>) in SELECT or ORDER BY (p an alias of properties; take the point from a property row or a place you resolved). Always filter properties by state_fips (a number, the first two digits of county_fips: 36 New York, 48 Texas, 12 Florida, 13 Georgia) and county_fips, and keep joins on property_id; use COUNT(*) and GROUP BY for totals; select property_id with the facts so rows link to records. Up to 1000 rows return as a downloadable table the user sees; the planner refuses queries that would scan whole states. Null means unpublished, never zero. On an error, read the message, fix the query and retry once. | |
| title | No |