search_places
Find locations using Google Places Text Search by entering a query and optional coordinates to retrieve place information.
Instructions
Search places via Google Places Text Search
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| location | No | lat,lng (optional) |
Implementation Reference
- src/apis/maps/google.ts:73-79 (handler)The handler function for the "search_places" tool. Validates configuration and arguments, then invokes the GoogleMapsClient.searchPlaces method to perform the API call.async search_places(args: Record<string, unknown>) { if (!cfg.googleApiKey) throw new Error("GOOGLE_API_KEY is not configured"); const query = String(args.query || ""); const location = args.location ? String(args.location) : undefined; if (!query) throw new Error("query is required"); return client.searchPlaces(query, location); },
- src/apis/maps/google.ts:39-46 (schema)Input schema defining the parameters for the search_places tool: required 'query' string and optional 'location' string.inputSchema: { type: "object", properties: { query: { type: "string" }, location: { type: "string", description: "lat,lng (optional)" }, }, required: ["query"], },
- src/apis/maps/google.ts:36-47 (registration)Tool registration object for search_places, including name, description, and schema, within registerGoogleMaps().{ name: "search_places", description: "Search places via Google Places Text Search", inputSchema: { type: "object", properties: { query: { type: "string" }, location: { type: "string", description: "lat,lng (optional)" }, }, required: ["query"], }, },
- src/tools/register.ts:22-33 (registration)Top-level tool registrations array in registerAllTools(), which includes registerGoogleMaps() thereby registering the search_places tool with the MCP server.const registrations: ToolRegistration[] = [ registerOpenWeather(), registerGoogleMaps(), registerNewsApi(), registerGitHub(), registerNotion(), registerTrello(), registerSpotify(), registerTwilio(), registerUnsplash(), registerCoinGecko(), ];
- src/apis/maps/google.ts:12-16 (helper)Supporting method in GoogleMapsClient class that constructs and sends the HTTP request to the Google Places Text Search endpoint.searchPlaces(query: string, location?: string) { return this.request("/maps/api/place/textsearch/json", { query: { query, location, key: this.apiKey }, }); }