Skip to main content
Glama

Ingest Accounts

ingest_accounts

Account 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

NameRequiredDescriptionDefault
labelNoLegend name for the point layer. Omitted: the point_layer id in title case (accounts is 'Accounts', schools_conus is 'Schools Conus').
id_fieldNoUnique 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_handleNoTerritory Solution reference (tsh_...) from a build, ingest_accounts, import_geojson, import_designer_project, or get_map_visualization; Territory Solutions are not accepted inline.
use_cacheNoAdmin 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_roleNocontractors marks the supply side of a service network (contractor, vendor, service provider) for analyze_network_coverage.
tier_fieldNoContractor column holding the network tier (e.g. Preferred). Retained like a declared column.
label_fieldNolabel
point_layerNoaccounts
region_hintNo
trade_fieldNoContractor column naming the trade(s) served (e.g. HVAC; comma-separated for several). Retained like a declared column.
country_hintNo
metric_fieldsNoAgent-confirmed business metric columns (for example revenue, sales, units) to persist on point-layer metadata for downstream build/analyze tools.
search_fieldsNoDeclared columns searchable in the Map Component. Undeclared columns are discarded at ingest and later operations on them fail with UNDECLARED_FIELD.
capacity_fieldNoNumeric contractor column holding capacity (e.g. jobs per month). Retained like a declared column.
display_fieldsNoDeclared columns shown in Map Component point callouts. Undeclared columns are discarded at ingest and later operations on them fail with UNDECLARED_FIELD.
latitude_fieldNoLatitude 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_idNoOpen map session (msess_...) from get_map_visualization. Its Territory Solution is the input; omit ts_handle when set.
min_confidenceNo
accounts_handleNoRequired. upload_handle (aup_...) from request_account_upload. Single-use: ingest claims it.
force_regeocodeNoAdmin keys only (debug/testing); a customer key gets ADMIN_REQUIRED. Leave false. True geocodes rows that already have coordinates, billing each one.
grouping_fieldsNoDeclared 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_fieldNoLongitude 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_fieldsNo
dwell_time_fieldNoCanonical per-account dwell column on point features. Pair with workload_fields unit metadata when values are in hours.
replace_existingNoWhen 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_fieldNoContractor column listing served ZIPs, comma-separated, for coverage.rule=zip_list. Retained like a declared column.
retry_bad_geocodesNoAdmin 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_fieldNoCanonical 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_geocodesNoWhen 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

NameRequiredDescriptionDefault
okYes
errorNoPresent when ok is false.
resultNoPresent when ok is true.
warningsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / force_regeocode / description
      Previous value: -"When true, ignore existing coordinates and geocode addresses. Also confirms intentional address geocoding when unused numeric lat/lon-like columns are present (skips needs_coordinate_fields guard)."New value: +"Admin keys only (debug/testing); a customer key gets ADMIN_REQUIRED. Leave false. True geocodes rows that already have coordinates, billing each one."
    • addedInput schema / properties / retry_bad_geocodes
      Added value: +{
      +  "default": false,
      +  "description": "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.",
      +  "title": "Retry Bad Geocodes",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / use_cache / description
      Added value: +"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."
  2. Changed1 schema field changed
    • addedInput schema / properties / replace_existing
      Added value: +{
      +  "default": false,
      +  "description": "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.",
      +  "title": "Replace Existing",
      +  "type": "boolean"
      +}
  3. Changed31 schema fields changed
    • addedInput schema / $defs
      Added value: +{
      +  "RepoShape1": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "field": {
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "label": {
      +        "type": "string"
      +      },
      +      "role": {
      +        "description": "Optional semantic role for workload columns. Agents should set visit_frequency or dwell_time when declaring canonical workload inputs.",
      +        "type": "string"
      +      },
      +      "type": {
      +        "enum": [
      +          "number",
      +          "integer",
      +          "string",
      +          "boolean"
      +        ],
      +        "type": "string"
      +      },
      +      "unit": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "field"
      +    ],
      +    "type": "object"
      +  }
      +}
    • addedInput schema / properties / accept_suboptimal_geocodes / description
      Added value: +"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."
    • addedInput schema / properties / accounts_handle / description
      Added value: +"Required. upload_handle (aup_...) from request_account_upload. Single-use: ingest claims it."
    • addedInput schema / properties / capacity_field / description
      Added value: +"Numeric contractor column holding capacity (e.g. jobs per month). Retained like a declared column."
    • addedInput schema / properties / display_fields / description
      Added value: +"Declared columns shown in Map Component point callouts. Undeclared columns are discarded at ingest and later operations on them fail with UNDECLARED_FIELD."
    • addedInput schema / properties / dwell_time_field / description
      Added value: +"Canonical per-account dwell column on point features. Pair with workload_fields unit metadata when values are in hours."
    • addedInput schema / properties / force_regeocode / description
      Added value: +"When true, ignore existing coordinates and geocode addresses. Also confirms intentional address geocoding when unused numeric lat/lon-like columns are present (skips needs_coordinate_fields guard)."
    • addedInput schema / properties / grouping_fields / description
      Added value: +"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."
    • addedInput schema / properties / id_field / description
      Added value: +"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."
    • addedInput schema / properties / label / description
      Added value: +"Legend name for the point layer. Omitted: the point_layer id in title case (accounts is 'Accounts', schools_conus is 'Schools Conus')."
    • addedInput schema / properties / latitude_field / description
      Added value: +"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."
    • addedInput schema / properties / layer_role / description
      Added value: +"contractors marks the supply side of a service network (contractor, vendor, service provider) for analyze_network_coverage."
    • addedInput schema / properties / longitude_field / description
      Added value: +"Longitude column. Defaults accept case-insensitive GIS aliases longitude/lon/lng/long (including LON). Override for non-standard headers. Explicit values win over aliases."
    • addedInput schema / properties / map_session_id / description
      Added value: +"Open map session (msess_...) from get_map_visualization. Its Territory Solution is the input; omit ts_handle when set."
    • changedInput schema / properties / metric_fields / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "default": [],
      +    "items": {
      +      "$ref": "#/$defs/RepoShape1"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / metric_fields / description
      Added value: +"Agent-confirmed business metric columns (for example revenue, sales, units) to persist on point-layer metadata for downstream build/analyze tools."
    • removedInput schema / properties / metric_fields / title
      Removed value: -"Metric Fields"
    • removedInput schema / properties / rows
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "items": {
      -        "additionalProperties": true,
      -        "type": "object"
      -      },
      -      "type": "array"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Rows"
      -}
    • addedInput schema / properties / search_fields / description
      Added value: +"Declared columns searchable in the Map Component. Undeclared columns are discarded at ingest and later operations on them fail with UNDECLARED_FIELD."
    • addedInput schema / properties / service_zip_field / description
      Added value: +"Contractor column listing served ZIPs, comma-separated, for coverage.rule=zip_list. Retained like a declared column."
    • addedInput schema / properties / tier_field / description
      Added value: +"Contractor column holding the network tier (e.g. Preferred). Retained like a declared column."
    • addedInput schema / properties / trade_field / description
      Added value: +"Contractor column naming the trade(s) served (e.g. HVAC; comma-separated for several). Retained like a declared column."
    • removedInput schema / properties / ts
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Ts"
      -}
    • addedInput schema / properties / ts_handle / description
      Added value: +"Territory Solution reference (tsh_...) from a build, ingest_accounts, import_geojson, import_designer_project, or get_map_visualization; Territory Solutions are not accepted inline."
    • addedInput schema / properties / visit_frequency_field / description
      Added value: +"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."
    • changedInput schema / properties / workload_fields / anyOf
      Previous value: -[
      -  {
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "default": [],
      +    "items": {
      +      "$ref": "#/$defs/RepoShape1"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / workload_fields / title
      Removed value: -"Workload Fields"
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / properties
      Added value: +{
      +  "error": {
      +    "description": "Present when ok is false.",
      +    "properties": {
      +      "ask_user": {
      +        "items": {
      +          "type": "string"
      +        },
      +        "type": "array"
      +      },
      +      "code": {
      +        "type": "string"
      +      },
      +      "details": {
      +        "type": "object"
      +      },
      +      "do_this_next": {
      +        "type": "object"
      +      },
      +      "message": {
      +        "type": "string"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "ok": {
      +    "type": "boolean"
      +  },
      +  "result": {
      +    "description": "Present when ok is true.",
      +    "properties": {
      +      "created_at": {
      +        "type": "string"
      +      },
      +      "do_this_next": {
      +        "type": "object"
      +      },
      +      "estimated_remaining_ms": {
      +        "type": "integer"
      +      },
      +      "estimated_start_ms": {
      +        "type": "integer"
      +      },
      +      "expires_at": {
      +        "type": "string"
      +      },
      +      "job_id": {
      +        "type": "string"
      +      },
      +      "next_action": {
      +        "type": "string"
      +      },
      +      "next_poll_at": {
      +        "type": "string"
      +      },
      +      "phase": {
      +        "type": "string"
      +      },
      +      "poll_interval_ms": {
      +        "type": "integer"
      +      },
      +      "poll_loop": {
      +        "type": "object"
      +      },
      +      "progress": {
      +        "type": "number"
      +      },
      +      "queue_depth": {
      +        "type": "integer"
      +      },
      +      "queue_lane": {},
      +      "queue_position": {
      +        "type": "integer"
      +      },
      +      "recommended_poll_delay_ms": {
      +        "type": "integer"
      +      },
      +      "required_input": {
      +        "type": "object"
      +      },
      +      "result_resource_uri": {
      +        "type": "string"
      +      },
      +      "sleep_ms": {
      +        "type": "integer"
      +      },
      +      "status": {
      +        "type": "string"
      +      },
      +      "status_resource_uri": {
      +        "type": "string"
      +      },
      +      "task_id": {
      +        "type": "string"
      +      },
      +      "terminal": {
      +        "type": "boolean"
      +      },
      +      "tool_name": {
      +        "type": "string"
      +      },
      +      "total": {
      +        "type": [
      +          "null",
      +          "number"
      +        ]
      +      },
      +      "user_cancelled": {
      +        "type": "boolean"
      +      }
      +    },
      +    "type": "object"
      +  },
      +  "warnings": {
      +    "items": {
      +      "properties": {
      +        "code": {
      +          "type": "string"
      +        },
      +        "message": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "type": "array"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "ok"
      +]
    • removedOutput schema / title
      Removed value: -"ingest_accountsDictOutput"
  4. Changed5 schema fields changed
    • addedInput schema / properties / capacity_field
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Capacity Field"
      +}
    • addedInput schema / properties / layer_role
      Added value: +{
      +  "anyOf": [
      +    {
      +      "enum": [
      +        "accounts",
      +        "contractors"
      +      ],
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Layer Role"
      +}
    • addedInput schema / properties / service_zip_field
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Service Zip Field"
      +}
    • addedInput schema / properties / tier_field
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Tier Field"
      +}
    • addedInput schema / properties / trade_field
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Trade Field"
      +}
  5. Changed3 schema fields changed
    • addedInput schema / properties / label / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / label / default
      Previous value: -"Accounts"New value: +null
    • removedInput schema / properties / label / type
      Removed value: -"string"
  6. Changed1 schema field changed
    • removedInput schema / properties / guidance_handle
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Guidance Handle"
      -}
  7. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the annotations, the description discloses substantial operational behavior: geocoding quota failures, per-address billing, single-use accounts_handle, duplicate-key and undeclared-field errors, column retention, and the returned task with failed_rows and map_refresh. This adds real context not supplied by readOnlyHint, openWorldHint, idempotentHint, or destructiveHint.

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 purpose is front-loaded and the dense paragraph avoids filler, but it is a long run-on string of constraints that requires careful parsing. The information is useful and mostly earns its place, though clearer separation between workflow, schema constraints, and error behavior would help.

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

Completeness4/5

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

For a 29-parameter ingest tool with an output schema and 79% schema description coverage, the description covers the main workflow, prerequisites, key failure modes, and return behavior. It leaves replace_existing, admin/debug flags, and some hint parameters to the schema, but those gaps are largely covered by structured fields.

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 beyond the 79%-covered schema by explaining coordinate alias passthrough, when latitude_field/longitude_field are required, unique-key behavior for id_field, the declared-column retention contract, contractor-specific fields, and the 100,000-row cap. Some parameters such as min_confidence and the hint fields are left to the schema, so it is strong but not exhaustive.

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 uses a specific verb and resource: it loads account rows as point data onto a named point layer and geocodes rows lacking coordinates. It also distinguishes the tool from request_account_upload by stating rows come only through accounts_handle, so an agent can identify the ingest step without opening the schema.

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?

It gives a clear prerequisite that rows must come from request_account_upload and notes the contractor-list use case via layer_role=contractors for analyze_network_coverage. It does not explicitly compare against import_geojson or import_designer_project, but the main when-to-use context is clear.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources