Skip to main content
Glama

Geocode Addresses

geocode_address

Geocode-only pass: turns staged customer addresses into coordinates with match confidence, without loading a map layer. The rows are staged with request_account_upload (file, csv_text, or rows; up to 10,000 rows here) and passed as its upload_handle; the handle is not claimed, so ingest_accounts can load the same rows afterward. Accepts address/address_line1/street, city, state, and postal columns (common source headers are mapped). accept_suboptimal_geocodes=true accepts ZIP-centroid matches. Each address is billed once: cached no-match and suboptimal verdicts return free (failed_rows cached_verdict); a corrected address is a new lookup. Billable lookups count against an annual per-key quota, and past it the result is PROVIDER_QUOTA_EXCEEDED with limit, used, remaining, and period_resets_at. Returns a task; the result has summary, sample_rows (10), failed_rows (first 50), a geocoded_rows_artifact with share_url for every row, and suggested_ingest. ingest_accounts alone also geocodes while it loads the map layer.

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": {
      "upload_handle": "<upload_handle>"
    },
    "name": "geocode_address"
  }
}

Input Schema

NameRequiredDescriptionDefault
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.
region_hintNo
country_hintNo
upload_handleYesupload_handle (aup_...) from request_account_upload holding the address rows. Not claimed: ingest_accounts can reuse it.
map_session_idNoOpen map session (msess_...) from get_map_visualization. Its Territory Solution is the input; omit ts_handle when set.
min_confidenceNo
force_regeocodeNoAdmin keys only (debug/testing); a customer key gets ADMIN_REQUIRED. Leave false. True geocodes rows that already have coordinates, billing each one.
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.
accept_suboptimal_geocodesNoWhen true, accept suboptimal geocodes (e.g. ZIP centroids). Default false so geocode-only workflows surface NO_OPTIMAL_GEOCODE for human review.

Output Schema

NameRequiredDescriptionDefault
okYes
errorNoPresent when ok is false.
resultNoPresent when ok is true. A submission returns the task reference (task_id, next_action, sleep_ms); the completed task result carries the remaining fields.
warningsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / force_regeocode / description
      Added 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. Changed9 schema fields changed
    • addedInput schema / properties / accept_suboptimal_geocodes / description
      Added value: +"When true, accept suboptimal geocodes (e.g. ZIP centroids). Default false so geocode-only workflows surface NO_OPTIMAL_GEOCODE for human review."
    • 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."
    • removedInput schema / properties / rows
      Removed value: -{
      -  "items": {
      -    "additionalProperties": true,
      -    "type": "object"
      -  },
      -  "title": "Rows",
      -  "type": "array"
      -}
    • addedInput schema / properties / upload_handle
      Added value: +{
      +  "description": "upload_handle (aup_...) from request_account_upload holding the address rows. Not claimed: ingest_accounts can reuse it.",
      +  "title": "Upload Handle",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "rows"
      -]New value: +[
      +  "upload_handle"
      +]
    • 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. A submission returns the task reference (task_id, next_action, sleep_ms); the completed task result carries the remaining fields.",
      +    "properties": {
      +      "do_this_next": {
      +        "type": [
      +          "object",
      +          "string"
      +        ]
      +      },
      +      "download_url": {
      +        "type": "string"
      +      },
      +      "failed_rows": {
      +        "items": {
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "failed_rows_truncated": {
      +        "type": "boolean"
      +      },
      +      "geocoded_rows_artifact": {
      +        "type": "object"
      +      },
      +      "job_id": {
      +        "type": "string"
      +      },
      +      "next_action": {
      +        "type": "string"
      +      },
      +      "sample_rows": {
      +        "items": {
      +          "type": "object"
      +        },
      +        "type": "array"
      +      },
      +      "share_url": {
      +        "type": "string"
      +      },
      +      "share_url_expires_at": {
      +        "type": "string"
      +      },
      +      "share_with_user": {
      +        "type": "string"
      +      },
      +      "sleep_ms": {
      +        "type": "integer"
      +      },
      +      "status": {
      +        "type": "string"
      +      },
      +      "suggested_ingest": {
      +        "type": "object"
      +      },
      +      "summary": {
      +        "type": "object"
      +      },
      +      "task_id": {
      +        "type": "string"
      +      },
      +      "terminal": {
      +        "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: -"geocode_addressDictOutput"
  3. Changed1 schema field changed
    • removedInput schema / properties / guidance_handle
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "title": "Guidance Handle"
      -}
  4. First observed

TDQS

A4.4/5.0
Behavior3/5

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

Annotations declare readOnlyHint=false, openWorldHint=true, idempotentHint=false and destructiveHint=false, and the description goes well beyond them: per-address billing, free cached no-match verdicts, annual per-key quota with PROVIDER_QUOTA_EXCEEDED plus limit/used/remaining/period_resets_at, non-claiming handle semantics, and async task return shape. That is strong added context on cost and quota, but it says nothing about the failure/partial-success contract for a batch of up to 10,000 rows, which is the main behavioral risk for a billed non-idempotent call.

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?

Front-loaded with the core purpose and the ingest_accounts contrast, then cost/quota, then return shape — a sensible order with no filler sentences. It is dense and runs long as a single block of semicolon-separated clauses, which costs a little scannability.

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?

For a 9-parameter, billed, asynchronous tool this covers the full call path: where the input handle comes from, what it costs, what the quota failure looks like, and what the result contains. An output schema exists, so the return-shape sentence is a bonus rather than a requirement, and nothing an agent needs in order to invoke it correctly is missing.

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?

Schema coverage is 67%, so the schema carries much of the load, yet the description adds real meaning: upload_handle is not claimed so ingest_accounts can reuse it, accept_suboptimal_geocodes trades ZIP-centroid matches against NO_OPTIMAL_GEOCODE review, and the cache/billing story explains why the admin-only flags should be left alone. region_hint, country_hint, and min_confidence get no narrative explanation, which keeps it short of a 5.

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 opening clause gives a specific verb and resource ('turns staged customer addresses into coordinates with match confidence') and immediately scopes it ('without loading a map layer'), which is exactly the axis that separates it from ingest_accounts. The closing sentence repeats the differentiation from the other direction, so an agent can route between the two without opening a schema.

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 states the prerequisite chain (rows staged via request_account_upload, passed as upload_handle) and names the alternative explicitly: 'ingest_accounts alone also geocodes while it loads the map layer.' It also flags the default-behavior consequence (NO_OPTIMAL_GEOCODE surfacing for human review) so the caller knows which mode they are opting into.

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