Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Google Maps

Scalekit connector
Open markdown

The Google Maps connector lets your AI agent act in each user's Google Maps account. Each user connects their own Google Maps API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 14 tools.

Tools
14
What they doRead · write · destructive
14 · 0 · 014 read0 write0 destructive
Users sign in with

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Google Maps connection

    In AgentKit > Connections, create a Google Maps connection. The name you give it is the connection_name your code passes. See Configure connections.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'googlemaps'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Google Maps:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'googlemaps_geolocate',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user opens the link once and enters their Google Maps credentials there. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • googlemaps_address_validateCheck and standardise a postal address, filling in missing parts and flagging components that look wrong.Read-only

    Validate Address

    Check and standardise a postal address, filling in missing parts and flagging components that look wrong. Returns a verdict (validation granularity, whether it's complete and whether parts were inferred or replaced), the corrected address, geocode, and USPS data for US addresses when requested, plus a responseId. Use this to verify a mailing or delivery address. Use geocode_address when you only need coordinates.

    Inputs

    address_linesarrayrequired
    The unstructured address lines, for example ["1600 Amphitheatre Pkwy", "Mountain View, CA 94043"]. You can put the whole address in one line. All address inputs together must be at most 280 characters.
    administrative_areastring
    State, province or region, if not already in address_lines. Example: CA.
    enable_usps_cassboolean
    If true, also run USPS CASS validation (US and Puerto Rico addresses only); region_code must be US or PR. Defaults to false.
    localitystring
    City or town, if not already in address_lines. Example: Mountain View.
    postal_codestring
    Postal or ZIP code, if not already in address_lines. Example: 94043.
    previous_response_idstring
    The responseId from a previous validation of the same address, when re-validating after the user edits it. Leave empty for a new address.
    region_codestring
    Two-letter CLDR region code of the address, such as US or GB. Strongly recommended; if omitted Google infers it from the address lines.
    session_tokenstring
    Autocomplete session token to end an autocomplete session with this validation for billing. URL-safe base64, at most 36 characters.
  • googlemaps_geocode_addressConvert a street address or place description into latitude and longitude.Read-only

    Geocode Address

    Convert a street address or place description into latitude and longitude. Returns matching results with location, formatted address, place ID, address components, granularity, viewport and types. Use this for address to coordinates. Use geocode_location for coordinates to address. Use places_search_text to find businesses.

    Inputs

    address_querystringrequired
    The address to geocode, as unstructured text. Include city and country when you can. Example: "1600 Amphitheatre Parkway, Mountain View, CA".
    field_maskstring
    Comma-separated list of response fields to return, sent as the X-Goog-FieldMask header. Optional. Leave empty to get every field. Google bills by the most expensive field requested. Optional; leave empty to get every field. Example: results.location,results.formattedAddress,results.placeId. Use "*" only for testing.
    language_codestring
    Preferred language for formatted addresses in the response, as a BCP-47 code such as en, fr or ja.
    region_codestring
    Two-letter ccTLD region code that biases (but does not restrict) results, such as us or gb. Useful for ambiguous names like "Toledo".
  • googlemaps_geocode_locationConvert a latitude and longitude into human-readable addresses (reverse geocoding).Read-only

    Reverse Geocode Location

    Convert a latitude and longitude into human-readable addresses (reverse geocoding). Returns results from most to least specific, each with formatted address, place ID, address components, granularity and types. Use this for coordinates to address. Use geocode_address for address to coordinates. Use places_search_nearby to find businesses near a point.

    Inputs

    latitudenumberrequired
    Latitude in decimal degrees. Example: 40.714224.
    longitudenumberrequired
    Longitude in decimal degrees. Example: -73.961452.
    field_maskstring
    Comma-separated list of response fields to return, sent as the X-Goog-FieldMask header. Optional. Leave empty to get every field. Google bills by the most expensive field requested. Optional; leave empty to get every field. Example: results.location,results.formattedAddress,results.placeId. Use "*" only for testing.
    granularityarray
    Keep only results with these location precisions: ROOFTOP (exact plot), RANGE_INTERPOLATED (estimated along a street), GEOMETRIC_CENTER (centre of an area), APPROXIMATE.
    language_codestring
    Preferred language for formatted addresses in the response, as a BCP-47 code such as en, fr or ja.
    region_codestring
    Two-letter CLDR/ccTLD region code that sets regional formatting and preferences, such as us, gb or in.
    typesarray
    Keep only results with at least one of these place types, for example ["street_address"] or ["locality", "postal_code"].
  • googlemaps_geocode_placeLook up the address and coordinates for a Google place ID.Read-only

    Geocode Place ID

    Look up the address and coordinates for a Google place ID. Returns a geocode result with location, formatted address, address components, viewport, bounds and types. Use this to turn a place ID into an address and coordinates. Use places_get for richer business details such as hours and ratings.

    Inputs

    place_idstringrequired
    The Google place ID to geocode. Example: ChIJj61dQgK6j4AR4GeTYWZsKWw.
    field_maskstring
    Comma-separated list of response fields to return, sent as the X-Goog-FieldMask header. Optional. Leave empty to get every field. Google bills by the most expensive field requested. Optional; leave empty to get every field. Example: location,formattedAddress. Use "*" only for testing.
    language_codestring
    Preferred language for formatted addresses in the response, as a BCP-47 code such as en, fr or ja.
    region_codestring
    Two-letter CLDR/ccTLD region code that sets regional formatting and preferences, such as us, gb or in.
  • googlemaps_geolocateEstimate a device's location from nearby cell towers and Wi-Fi access points, falling back to the caller's IP address.Read-only

    Geolocate Device

    Estimate a device's location from nearby cell towers and Wi-Fi access points, falling back to the caller's IP address. Returns location (lat, lng) and accuracy in meters. Use this when you have radio signal data instead of coordinates. Note that without towers or access points the result is the location of the server calling Google, not the end user.

    Inputs

    carrierstring
    Name of the mobile carrier.
    cell_towersarray
    Cell towers the device can see. Each tower needs its cellId, locationAreaCode, mobileCountryCode and mobileNetworkCode (NR towers use newRadioCellId instead of cellId); signal strength and age are optional. Example: [{"cellId": 170402199, "locationAreaCode": 35632, "mobileCountryCode": 310, "mobileNetworkCode": 410}].
    consider_ipboolean
    If true (default), fall back to the IP address of the request when tower and Wi-Fi data are missing or insufficient. Since Scalekit sends the request, that IP is not the end user's; set false to get a not-found error instead of a misleading location.
    home_mobile_country_codeinteger
    Mobile country code (MCC) of the device's home network, 0 to 999.
    home_mobile_network_codeinteger
    Mobile network code (MNC) of the device's home network, or SID for CDMA.
    radio_typestring
    Mobile radio type of the cell towers: gsm (default), cdma, wcdma, lte or nr.one of gsmcdmawcdmaltenr
    wifi_access_pointsarray
    Wi-Fi access points the device can see; give at least two. Each needs a macAddress and can include signalStrength (dBm), channel and age. Example: [{"macAddress": "3c:37:86:5d:75:d4", "signalStrength": -35}, {"macAddress": "30:86:2d:c4:29:d0", "signalStrength": -35}].
  • googlemaps_places_autocompleteGet place and query suggestions for partial text as a user types, such as "pizza in new y".Read-only

    Autocomplete Places

    Get place and query suggestions for partial text as a user types, such as "pizza in new y". Returns up to five suggestions, each a place prediction (place ID, text, types, and distance if an origin is given) or a query prediction. Use this for type-ahead input. Use places_search_text for full search results. Pass a chosen place ID to places_get with the same session_token.

    Inputs

    inputstringrequired
    The partial text to complete, as typed so far. Example: "pizza in new y".
    field_maskstring
    Comma-separated list of response fields to return, sent as the X-Goog-FieldMask header. Optional. Leave empty to get every field. Google bills by the most expensive field requested. Example: suggestions.placePrediction.placeId,suggestions.placePrediction.text. Use "*" only for testing.
    include_query_predictionsboolean
    If true, the response can include query predictions (suggested search strings) as well as place predictions. Defaults to false.
    included_primary_typesarray
    Up to five primary place types to restrict suggestions to, for example ["restaurant"], or one of the collections (regions) or (cities).
    included_region_codesarray
    Up to 15 two-letter region codes to restrict results to, for example ["us", "ca"].
    input_offsetinteger
    Zero-based Unicode character offset of the cursor in input. Defaults to the length of input.
    language_codestring
    Preferred language for suggestions in the response, as a BCP-47 code such as en, fr or ja.
    location_bias_latitudenumber
    Latitude in decimal degrees of the centre of a circle that results should favour. Set together with location_bias_longitude; results outside the circle can still appear.
    location_bias_longitudenumber
    Longitude in decimal degrees of the centre of the bias circle. Set together with location_bias_latitude.
    location_bias_radius_metersnumber
    Radius in meters of the bias circle, from 0 to 50000. Used only when location_bias_latitude and location_bias_longitude are set.
    origin_latitudenumber
    Latitude of the origin used to calculate distanceMeters for each prediction. Set together with origin_longitude.
    origin_longitudenumber
    Longitude of the origin used to calculate distanceMeters for each prediction. Set together with origin_latitude.
    region_codestring
    Two-letter CLDR/ccTLD region code that sets regional formatting and preferences, such as us, gb or in.
    session_tokenstring
    Session token that groups autocomplete calls and the final places_get call into one billing session. Use a URL-safe base64 string of at most 36 characters, such as a UUID, and reuse it until a place is selected.
  • googlemaps_places_getGet details for one place by its Google place ID, such as address, phone, website, opening hours, rating, price level and photos.Read-only

    Get Place Details

    Get details for one place by its Google place ID, such as address, phone, website, opening hours, rating, price level and photos. Returns a place object with the fields named in field_mask. Use this when you already have a place ID. Use places_search_text or places_search_nearby to find place IDs. Use geocode_place for just the address and coordinates.

    Inputs

    place_idstringrequired
    The Google place ID, as returned in the id field of a search or autocomplete result. Example: ChIJj61dQgK6j4AR4GeTYWZsKWw.
    field_maskstring
    Comma-separated list of response fields to return, sent as the X-Goog-FieldMask header. Google requires a field mask for this method and bills by the most expensive field requested. Use top-level place field names without a prefix, e.g. id,displayName,formattedAddress,regularOpeningHours. Add photos to get photo names for places_photo_get. Use "*" only for testing.default id,displayName,formattedAddress,location,types,primaryType,rating,userRatingCount,priceLevel,businessStatus,googleMapsUri,websiteUri,nationalPhoneNumber,internationalPhoneNumber,regularOpeningHours,editorialSummary,photos
    language_codestring
    Preferred language for names and addresses in the response, as a BCP-47 code such as en, fr or ja.
    region_codestring
    Two-letter CLDR/ccTLD region code that sets regional formatting and preferences, such as us, gb or in.
    session_tokenstring
    Autocomplete session token. Pass the same token used in the places_autocomplete calls that led to this place to close the session for billing. Must be URL- and filename-safe base64, at most 36 characters.
  • googlemaps_places_photo_getGet a short-lived image URL for one photo of a place, scaled to a maximum width or height.Read-only

    Get Place Photo URL

    Get a short-lived image URL for one photo of a place, scaled to a maximum width or height. Returns the photo resource name and photoUri, a direct link to the image. Use this after places_get or a search with photos in field_mask. Each photo's name has the form places/PLACE_ID/photos/PHOTO_ID.

    Inputs

    photo_idstringrequired
    The photo ID part of the photo's resource name places/PLACE_ID/photos/PHOTO_ID, taken from the photos[].name field of a place. It's a long opaque string.
    place_idstringrequired
    The place ID part of the photo's resource name places/PLACE_ID/photos/PHOTO_ID. Example: ChIJj61dQgK6j4AR4GeTYWZsKWw.
    max_height_pxinteger
    Maximum image height in pixels, from 1 to 4800. The image is scaled down to fit, keeping its aspect ratio.
    max_width_pxinteger
    Maximum image width in pixels, from 1 to 4800. The image is scaled down to fit, keeping its aspect ratio. Defaults to 800.default 800