Skip to main content
Glama

serp_google_maps

Search Google Maps for locations and get structured results including places, addresses, and contact info. Supports pagination, country, and language filters for localized searches.

Instructions

Search Google Maps for locations.

Performs a Google Maps search and returns structured map results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query string for maps/location search. Required.
countryNoCountry code for localized results (e.g., 'us', 'cn', 'uk'). Default is 'us'.
languageNoLanguage code for results (e.g., 'en', 'zh-cn', 'fr'). Default is 'en'.
numberNoNumber of results per page (default: 10). Note: More than 10 results may incur additional credits.
pageNoPage number for pagination (default: 1).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The async function that handles the 'serp_google_maps' MCP tool. It delegates to serp_google_search with search_type='maps'.
    @mcp.tool()
    async def serp_google_maps(
        query: Annotated[
            str,
            Field(description="The search query string for maps/location search. Required."),
        ],
        country: Annotated[
            str | None,
            Field(
                description="Country code for localized results (e.g., 'us', 'cn', 'uk'). Default is 'us'."
            ),
        ] = None,
        language: Annotated[
            str | None,
            Field(
                description="Language code for results (e.g., 'en', 'zh-cn', 'fr'). Default is 'en'."
            ),
        ] = None,
        number: Annotated[
            int | None,
            Field(
                description="Number of results per page (default: 10). Note: More than 10 results may incur additional credits."
            ),
        ] = None,
        page: Annotated[
            int | None,
            Field(description="Page number for pagination (default: 1)."),
        ] = None,
    ) -> str:
        """Search Google Maps for locations.
    
        Performs a Google Maps search and returns structured map results.
        """
        result: str = await serp_google_search(
            query=query,
            search_type="maps",
            country=country,
            language=language,
            number=number,
            page=page,
        )
        return result
  • main.py:174-174 (registration)
    Registration of the 'serp_google_maps' tool in the MCP server's tool list in main.py.
    {"name": "serp_google_maps", "description": "Search Google Maps"},
  • The underlying serp_google_search function that serp_google_maps delegates to, building the API payload with search_type='maps'.
    try:
        # Build payload
        payload: dict = {"query": query, "type": search_type}
    
        if country:
            payload["country"] = country
        if language:
            payload["language"] = language
        if time_range:
            payload["range"] = time_range
        if number:
            payload["number"] = number
        if page:
            payload["page"] = page
    
        result = await client.search(**payload)
    
        if not result:
            return json.dumps({"error": "No results found for your query."})
    
        return json.dumps(result, ensure_ascii=False, indent=2)
    
    except SerpAuthError as e:
        return json.dumps({"error": "Authentication Error", "message": e.message})
    except SerpAPIError as e:
        return json.dumps({"error": "API Error", "message": e.message})
    except Exception as e:
        return json.dumps({"error": "Error performing search", "message": str(e)})
  • main.py:123-123 (registration)
    Listing the tool in the terminal/console output during startup.
    safe_print("    - serp_google_maps")
  • Pydantic Field annotations defining input parameters (query, country, language, number, page) for the serp_google_maps tool.
    async def serp_google_maps(
        query: Annotated[
            str,
            Field(description="The search query string for maps/location search. Required."),
        ],
        country: Annotated[
            str | None,
            Field(
                description="Country code for localized results (e.g., 'us', 'cn', 'uk'). Default is 'us'."
            ),
        ] = None,
        language: Annotated[
            str | None,
            Field(
                description="Language code for results (e.g., 'en', 'zh-cn', 'fr'). Default is 'en'."
            ),
        ] = None,
        number: Annotated[
            int | None,
            Field(
                description="Number of results per page (default: 10). Note: More than 10 results may incur additional credits."
            ),
        ] = None,
        page: Annotated[
            int | None,
            Field(description="Page number for pagination (default: 1)."),
        ] = None,
    ) -> str:
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It only mentions basic functionality (search and return structured results). It fails to disclose behavioral traits like pagination limits, credit costs (partially covered in schema parameter note but not in description), or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short, clear sentences with no filler or repetition. Efficient but could be slightly more informative without bloat.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple search tool with output schema and fully described parameters, the description is adequate. However, it lacks usage guidelines and behavioral transparency, which would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all parameters. The description adds no extra context beyond what is in the schema. Baseline 3 due to high coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it searches Google Maps for locations and returns structured results, distinguishing it from siblings like images or news searches. However, it does not differentiate from the similar serp_google_places tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, such as serp_google_places or serp_google_search. No context on when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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/AceDataCloud/SerpMCP'

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