Skip to main content
Glama

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
NameRequiredDescriptionDefault
queryYes
locationNolat,lng (optional)

Implementation Reference

  • 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); },
  • 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"], },
  • 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"], }, },
  • 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(), ];
  • 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 }, }); }

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/TaylorChen/muti-mcps'

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