Skip to main content
Glama
cablate

MCP Google Map Server

get_place_details

Retrieve comprehensive details of a specific location using its Google Maps place ID through the MCP Google Map Server. Ideal for developers needing precise location data.

Instructions

獲取特定地點的詳細資訊

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
placeIdYesGoogle Maps 地點 ID

Implementation Reference

  • The ACTION function implementing the core logic of the get_place_details tool. It uses PlacesSearcher to fetch details and returns formatted content or error.
    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}` }], }; } }
  • Zod schema defining the input parameters for the tool: placeId (string).
    const SCHEMA = { placeId: z.string().describe("Google Maps place ID"), };
  • src/config.ts:29-33 (registration)
    Tool registration in server configuration, specifying name, description, schema, and action handler.
    { name: PlaceDetails.NAME, description: PlaceDetails.DESCRIPTION, schema: PlaceDetails.SCHEMA, action: (params: PlaceDetailsParams) => PlaceDetails.ACTION(params),

Other Tools

Related Tools

Latest Blog Posts

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