agentskit.js
ToolsIntegrations

maps

Geocoding + reverse-geocoding via any provider with an HTTP API (Google, Mapbox, OpenCage, Positionstack, Nominatim).

import { maps } from '@agentskit/tools'

const runtime = createRuntime({
  adapter,
  tools: [...maps({
    provider: 'google',
    apiKey: process.env.GOOGLE_MAPS_KEY!,
  })],
})

Sub-tools

NamePurpose
mapsGeocodeAddress → lat/lng
mapsReverseGeocodelat/lng → address

Bundled: maps(config).

Config

type MapsConfig = {
  provider?: 'google' | 'mapbox' | 'opencage' | 'nominatim'
  apiKey?: string
  fetch?: typeof fetch
}

Example — travel planner

const runtime = createRuntime({
  adapter,
  tools: [
    ...maps({ provider: 'mapbox', apiKey }),
    ...weather(),
  ],
})

await runtime.run('Find the coordinates of "Lisbon waterfront" and check the weather there tomorrow.')
✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page