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 (required — the tool handlers read this directly and do not fall back to an api_key config value).

api_key
stringRequired

Schema-level declaration for the Google Maps API key. The tool handlers read the GOOGLE_MAPS_API_KEY environment variable at request time; a config value is not used as a fallback.

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();