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

Explore nearby

✎ Edit this page on GitHubΒ·Found a problem? Open an issue β†’Β·How to contribute β†’

On this page