Skip to main content
Glama
garylab

Serper MCP Server

by garylab

google_search_reviews

Retrieve Google reviews for a business or place using identifiers like FID, CID, or place ID. Filter results by language, country, sort order, and paginate through pages.

Instructions

Search Google for results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fidYesThe FID
cidNoThe CID to search in
placeIdNoThe place ID to search in
sortByNoThe sort order to use (enum value as string: 'mostRelevant', 'newest', 'highestRating', 'lowestRating')mostRelevant
topicIdNoThe topic ID to search in
nextPageTokenNoThe next page token to use
glNoThe country to search in, e.g. us, uk, ca, au, etc.
hlNoThe language to search in, e.g. en, es, fr, de, etc.

Implementation Reference

  • Registration mapping: GOOGLE_SEARCH_REVIEWS is mapped to ReviewsRequest in google_request_map, used to register the tool via list_tools()
    google_request_map = {
        SerperTools.GOOGLE_SEARCH: SearchRequest,
        SerperTools.GOOGLE_SEARCH_IMAGES: SearchRequest,
        SerperTools.GOOGLE_SEARCH_VIDEOS: SearchRequest,
        SerperTools.GOOGLE_SEARCH_PLACES: AutocorrectRequest,
        SerperTools.GOOGLE_SEARCH_MAPS: MapsRequest,
        SerperTools.GOOGLE_SEARCH_REVIEWS: ReviewsRequest,
        SerperTools.GOOGLE_SEARCH_NEWS: SearchRequest,
  • ReviewsRequest schema: Pydantic model defining input fields (fid required, cid, placeId, sortBy, topicId, nextPageToken, gl, hl optional) for the google_search_reviews tool
    class ReviewsRequest(BaseModel):
        fid: str = Field(..., description="The FID")
        cid: Optional[str] = Field(None, description="The CID to search in")
        placeId: Optional[str] = Field(None, description="The place ID to search in")
        sortBy: Optional[str] = Field(
            "mostRelevant",
            pattern=r"^(mostRelevant|newest|highestRating|lowestRating)$",
            description="The sort order to use (enum value as string: 'mostRelevant', 'newest', 'highestRating', 'lowestRating')",
        )
        topicId: Optional[str] = Field(None, description="The topic ID to search in")
        nextPageToken: Optional[str] = Field(None, description="The next page token to use")
        gl: Optional[str] = Field(
            None, description="The country to search in, e.g. us, uk, ca, au, etc."
        )
        hl: Optional[str] = Field(
            None, description="The language to search in, e.g. en, es, fr, de, etc."
        )
  • Handler call_tool: when name='google_search_reviews', it creates a ReviewsRequest from arguments, then calls google(tool, request) which sends to the Serper API
    @server.call_tool()
    async def call_tool(name: str, arguments: dict[str, Any]) -> Sequence[TextContent | ImageContent | EmbeddedResource]:
        if not SERPER_API_KEY:
            return [TextContent(text=f"SERPER_API_KEY is empty!", type="text")]
    
        try:
            if name == SerperTools.WEBPAGE_SCRAPE.value:
                request = WebpageRequest(**arguments)
                result = await scape(request)
                return [TextContent(text=json.dumps(result, indent=2), type="text")]
    
            if not SerperTools.has_value(name):
                raise ValueError(f"Tool {name} not found")
    
            tool = SerperTools(name)
            request = google_request_map[tool](**arguments)
            result = await google(tool, request)
            return [TextContent(text=json.dumps(result, indent=2), type="text")]
        except Exception as e:
            return [TextContent(text=f"Error: {str(e)}", type="text")]
  • Helper function google(): derives the API endpoint from the tool name suffix (e.g. 'reviews'), builds URL, and calls fetch_json to POST to Serper API
    async def google(tool: SerperTools, request: BaseModel) -> Dict[str, Any]:
        uri_path = tool.value.split("_")[-1]
        url = f"https://google.serper.dev/{uri_path}"
        return await fetch_json(url, request)
Behavior1/5

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

No annotations provided. The description does not disclose any behavioral traits (e.g., that it fetches reviews, pagination behavior, or data availability).

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

Conciseness2/5

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

Overly brief single sentence that omits critical details; under-specification rather than conciseness.

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

Completeness1/5

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

With 8 parameters and no output schema, the description is completely inadequate. It does not explain what the tool does (search reviews), how it relates to sibling tools, or any behavioral details.

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 coverage is 100% with parameter descriptions already provided. The description adds no additional meaning beyond what's in the schema.

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

Purpose2/5

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

The description 'Search Google for results' is vague and does not specify that this tool is for reviews. It fails to distinguish from siblings like google_search or google_search_places that also search Google for results.

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?

No guidelines on when to use this tool versus alternatives. No context on prerequisites or use cases.

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/garylab/serper-mcp-server'

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