Skip to main content
Glama

MCP Google Map Server

placeDetails.ts1.48 kB
import { z } from "zod"; import { PlacesSearcher } from "../../services/PlacesSearcher.js"; import { getCurrentApiKey } from "../../utils/requestContext.js"; const NAME = "get_place_details"; const DESCRIPTION = "Get detailed information about a specific place including contact details, reviews, ratings, and operating hours"; const SCHEMA = { placeId: z.string().describe("Google Maps place ID"), }; export type PlaceDetailsParams = z.infer<z.ZodObject<typeof SCHEMA>>; async function ACTION(params: any): Promise<{ content: any[]; isError?: boolean }> { try { // Create a new PlacesSearcher instance with the current request's API key const apiKey = getCurrentApiKey(); const placesSearcher = new PlacesSearcher(apiKey); const result = await placesSearcher.getPlaceDetails(params.placeId); if (!result.success) { return { content: [{ type: "text", text: result.error || "Failed to get place details" }], isError: true, }; } return { content: [ { type: "text", text: JSON.stringify(result.data, null, 2), }, ], isError: false, }; } catch (error: any) { const errorMessage = error instanceof Error ? error.message : JSON.stringify(error); return { isError: true, content: [{ type: "text", text: `Error getting place details: ${errorMessage}` }], }; } } export const PlaceDetails = { NAME, DESCRIPTION, SCHEMA, ACTION, };

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cablate/mcp-google-map'

If you have feedback or need assistance with the MCP directory API, please join our Discord server