Ingest Accounts
ingest_accountsAccount ingest: loads account rows (CRM records, a CSV, a spreadsheet) as point data on a named point layer of the Territory Solution, to add them to the map, geocoding rows without coordinates. Rows come only as accounts_handle from request_account_upload (a file, csv_text, or rows; 100,000-row cap); its suggested_ingest carries these args. latitude/lat and longitude/lon/lng pass through; other names need latitude_field/longitude_field, and unused coordinate-like columns return CLARIFICATION_REQUIRED (needs_coordinate_fields). id_field is a unique key (default row_id); duplicates return needs_unique_row_id. Only declared columns are kept: metric_fields, workload_fields, dwell_time_field, visit_frequency_field, grouping_fields, display_fields, search_fields; to load a contractor list, layer_role=contractors adds trade_field, tier_field, capacity_field, service_zip_field (analyze_network_coverage). Later use of an undeclared column returns UNDECLARED_FIELD. Over geocode quota fails it whole; a bad address bills once (fix it to retry). Returns a task with failed_rows and map_refresh.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "ingest_accounts"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No | Legend name for the point layer. Omitted: the point_layer id in title case (accounts is 'Accounts', schools_conus is 'Schools Conus'). | |
| id_field | No | Unique business key column. Duplicated label/name columns fail with blocked_by=needs_unique_row_id. With the default row_id and no unique column, the server synthesizes row-1, row-2, … when that column is absent. | row_id |
| ts_handle | No | Territory Solution reference (tsh_...) from a build, ingest_accounts, import_geojson, import_designer_project, or get_map_visualization; Territory Solutions are not accepted inline. | |
| use_cache | No | Admin keys only (debug/testing); a customer key gets ADMIN_REQUIRED. Leave true. False skips both geocode caches and bills a provider lookup for every address. | |
| layer_role | No | contractors marks the supply side of a service network (contractor, vendor, service provider) for analyze_network_coverage. | |
| tier_field | No | Contractor column holding the network tier (e.g. Preferred). Retained like a declared column. | |
| label_field | No | label | |
| point_layer | No | accounts | |
| region_hint | No | ||
| trade_field | No | Contractor column naming the trade(s) served (e.g. HVAC; comma-separated for several). Retained like a declared column. | |
| country_hint | No | ||
| metric_fields | No | Agent-confirmed business metric columns (for example revenue, sales, units) to persist on point-layer metadata for downstream build/analyze tools. | |
| search_fields | No | Declared columns searchable in the Map Component. Undeclared columns are discarded at ingest and later operations on them fail with UNDECLARED_FIELD. | |
| capacity_field | No | Numeric contractor column holding capacity (e.g. jobs per month). Retained like a declared column. | |
| display_fields | No | Declared columns shown in Map Component point callouts. Undeclared columns are discarded at ingest and later operations on them fail with UNDECLARED_FIELD. | |
| latitude_field | No | Latitude column. Defaults accept case-insensitive GIS aliases latitude/lat (including LAT). Override for non-standard headers (e.g. Address 1: Latitude). Explicit values win over aliases. | latitude |
| map_session_id | No | Open map session (msess_...) from get_map_visualization. Its Territory Solution is the input; omit ts_handle when set. | |
| min_confidence | No | ||
| accounts_handle | No | Required. upload_handle (aup_...) from request_account_upload. Single-use: ingest claims it. | |
| force_regeocode | No | Admin keys only (debug/testing); a customer key gets ADMIN_REQUIRED. Leave false. True geocodes rows that already have coordinates, billing each one. | |
| grouping_fields | No | Declared columns used to group accounts (e.g. account_build grouping_field candidates). Declared fields are the retention contract: the compact TS keeps only id, coordinates, label, and declared fields; undeclared columns are discarded at ingest. | |
| longitude_field | No | Longitude column. Defaults accept case-insensitive GIS aliases longitude/lon/lng/long (including LON). Override for non-standard headers. Explicit values win over aliases. | longitude |
| workload_fields | No | ||
| dwell_time_field | No | Canonical per-account dwell column on point features. Pair with workload_fields unit metadata when values are in hours. | |
| replace_existing | No | When true, replaces an existing point layer with the same point_layer id in place. Default false returns POINT_LAYER_EXISTS when the layer already exists. | |
| service_zip_field | No | Contractor column listing served ZIPs, comma-separated, for coverage.rule=zip_list. Retained like a declared column. | |
| retry_bad_geocodes | No | Admin keys only (debug/testing); a customer key gets ADMIN_REQUIRED. Leave false. True re-asks the provider, billed, for the same address text whose cached verdict is no-match or suboptimal. A corrected address needs no flag: it is a new lookup. | |
| visit_frequency_field | No | Canonical numeric visits-per-cycle column on point features. Agent-resolved; MCP validates presence and persists on point-layer metadata. Without one, MCP defaults each account to one visit per cycle. | |
| accept_suboptimal_geocodes | No | When true (default for ingest), accept provider suboptimal geocodes (e.g. ZIP centroids) so address-only rows become points. Set false to require optimal/point-address matches only. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | No | Present when ok is false. | |
| result | No | Present when ok is true. | |
| warnings | No |