google_maps_places
Search for places on Google Maps using text queries or nearby locations. Find restaurants, shops, landmarks, and other points of interest with customizable filters for type, radius, and language.
Instructions
Search for places using Google Maps Platform. Find restaurants, shops, landmarks, and more by text query or nearby location.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Text search query (e.g., 'coffee near Gangnam Station') | |
| location | No | Latitude,longitude for nearby search (e.g., '37.4979,127.0276') | |
| radius | No | Search radius in meters (max 50000) | |
| type | No | Place type filter (e.g., restaurant, cafe, hospital) | |
| language | No | Language for results (e.g., ko, en, ja) |
Implementation Reference
- src/index.ts:16-40 (handler)The tool handler is defined generically in `src/index.ts`. It takes the tool definition from `allTools` and makes a request via `gatewayRequest` to the configured `endpoint`.
server.tool( tool.name, tool.description, tool.inputSchema.shape, async (params) => { const method = tool.method || "POST"; const result = await gatewayRequest(method, tool.endpoint, params as Record<string, unknown>); if (result.error) { return { content: [{ type: "text" as const, text: `Error (${result.status}): ${result.error}` }], isError: true, }; } const text = typeof result.data === "string" ? result.data : JSON.stringify(result.data, null, 2); return { content: [{ type: "text" as const, text }], }; }, ); } - src/tools/google-maps.ts:4-16 (registration)Registration of the "google_maps_places" tool, including its schema and the API endpoint it maps to.
export const googleMapsTools: ToolDef[] = [ { name: "google_maps_places", description: "Search for places using Google Maps Platform. Find restaurants, shops, landmarks, and more by text query or nearby location.", inputSchema: z.object({ query: z.string().optional().describe("Text search query (e.g., 'coffee near Gangnam Station')"), location: z.string().optional().describe("Latitude,longitude for nearby search (e.g., '37.4979,127.0276')"), radius: z.number().optional().describe("Search radius in meters (max 50000)"), type: z.string().optional().describe("Place type filter (e.g., restaurant, cafe, hospital)"), language: z.string().optional().describe("Language for results (e.g., ko, en, ja)"), }), endpoint: "/v1/google-maps/places", },