Skip to content
agentskit.js
ToolsIntegrations

maps

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

import { maps } from '@agentskit/tools/integrations'

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.')

Explore nearby

Ask the docs
Ask anything about AgentsKit. Answers come from the docs corpus and cite their sources.