Skip to main content
Glama

geocode

Convert an address or place name into WGS84 latitude/longitude coordinates. Returns a confidence score to indicate result reliability.

Instructions

Convert an address or place name into WGS84 coordinates (lat/lon).

Returns: formatted_address (string), coordinates {lat, lon}, city, country, confidence (0–1).

WHEN TO USE: When you have a human-readable address and need lat/lon. DO NOT USE: For coordinates-to-address (use reverse_geocode). For real-time user typing (use autocomplete).

CONFIDENCE: Score below 0.6 means the result is ambiguous — ask the user to clarify the address before proceeding. Score above 0.85 is reliable.

CACHING: Within an agent session, never re-geocode the same address string. Cache the result and reuse it.

COUNTRY BIAS: Always pass countries when the user's region is known — dramatically improves accuracy for short or ambiguous addresses (e.g. "Springfield" returns the right one).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYesFull address or place name to geocode.
countriesNoISO 3166-1 alpha-2 country codes to bias results. Comma-separated, max 4. Pass this whenever the user's country is known.
limitNoMax results to return. Default 5, max 25. Use 1 when you need a single best match.
langNoResponse language code (BCP 47). Default: en.
focus.latNoLatitude to bias results toward (e.g. user's current location). Range: -90 to 90.
focus.lonNoLongitude to bias results toward. Range: -180 to 180.
Behavior5/5

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

With no annotations, the description fully discloses behavior: return format, confidence interpretation, caching policy, and country bias. No hidden side effects; geocoding is read-only.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with clear sections. Every sentence adds value; no waste. Front-loaded with the core purpose and return format.

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?

Despite no output schema, the description covers return format, confidence interpretation, caching, and bias. For a geocoding tool, this is comprehensive and actionable.

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 100% with good descriptions. The description adds usage context (e.g., 'Always pass countries when the user's region is known') and explains parameter roles, but schema already covers basic semantics.

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 clearly states 'Convert an address or place name into WGS84 coordinates (lat/lon).' It distinguishes from reverse_geocode and autocomplete, providing a precise verb-resource pairing.

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?

Explicit 'WHEN TO USE' and 'DO NOT USE' sections with references to sibling tools. Additional guidance on confidence thresholds, caching, and country bias provides clear decision-support.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/algolayertechnologies/mapsi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server