Skip to navigation

GoogleMapsSkill

View as MarkdownOpen in Claude

Validate and geocode a street address or business name, and compute the driving distance and travel time between two coordinates, using Google Maps APIs.

Class: GoogleMapsSkill

Tools: lookup_address, compute_route (each tool name is configurable).

Env vars: GOOGLE_MAPS_API_KEY (used when api_key is not supplied).

api_key
stringRequired

Google Maps API key, with the Geocoding and Routes APIs enabled. Falls back to the GOOGLE_MAPS_API_KEY environment variable when the config value is not supplied. setup() fails when neither is set.

route_tool_name
stringDefaults to compute_route

Custom name for the route computation tool.

lookup_tool_name
stringDefaults to lookup_address

Custom name for the address / place lookup tool.

import { AgentBase, GoogleMapsSkill } from '@signalwire/sdk';
const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
agent.setPromptText('You are a helpful assistant.');
await agent.addSkill(new GoogleMapsSkill({
route_tool_name: 'get_driving_time',
}));
agent.run();