Skip to main content
Glama
brave

Brave Search MCP Server

Official

brave_place_search

brave_place_search

Find points of interest and businesses in a geographic area. Returns structured data including name, address, opening hours, ratings, contact info, and categories. Use latitude/longitude or a location string.

Instructions

Searches for points of interest (POIs) in a specified geographic area using Brave's Place Search API. Each result includes rich, structured data such as the place's name, URL, postal address, opening hours, contact info, ratings, photos, categories, and timezone.

When to use:
    - Finding places near a set of coordinates or a named location (e.g. "coffee shops near me", "bookstores in Paris")
    - Browsing general points of interest in an area when no query is supplied
    - Building a place-finding experience that needs structured business data (hours, ratings, etc.)
    - Augmenting an answer with the location's address, phone number, or rating

Provide a search area via 'latitude' + 'longitude' or a 'location' string (or both). When neither is provided, a 'query' is expected. Use 'count' to keep responses small (max 50, default 20).

For US locations the recommended 'location' format is '<city> <state> <country name>' (e.g. 'san francisco ca united states'); for non-US locations use '<city> <country name>' (e.g. 'tokyo japan').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoQuery string to search for points of interest in an area. If no query is provided, the endpoint will return general points of interest in the given area.
radiusNoSearch radius around the supplied coordinates, in meters. If omitted, the search is performed globally.
countNoNumber of results to return. Maximum is 50. Default is 20.
latitudeNoLatitude of the geographical coordinates around which to search, in degrees (-90 to 90). Typically paired with `longitude`.
longitudeNoLongitude of the geographical coordinates around which to search, in degrees (-180 to 180). Typically paired with `latitude`.
locationNoLocation string to search around, used as an alternative to `latitude` and `longitude`. For US locations prefer the form '<city> <state> <country name>' (e.g. 'san francisco ca united states'); for non-US locations use '<city> <country name>' (e.g. 'tokyo japan'). No commas or special characters needed; capitalization does not matter.
countryNoTwo-letter country code (ISO 3166-1 alpha-2) used to scope the search. Defaults to 'US'.
search_langNoLanguage for the search results. Defaults to 'en'.
ui_langNoUser interface language for the response, usually of the form '<language>-<region>'. Defaults to 'en-US'.
unitsNoUnits of measurement for distance values. Defaults to 'metric'.
safesearchNoSafe search level for the query results. 'off' - No filtering. 'moderate' - Filter out explicit content. 'strict' - Filter out explicit and suggestive content. Defaults to 'strict'.
spellcheckNoWhether to apply spellcheck before executing the search. Defaults to true.
geolocNoOptional geolocation token used to refine results.
api-versionNoThe API version to use. This is denoted by the format YYYY-MM-DD. Default is the latest that is available. Read more about API versioning at https://api-dashboard.search.brave.com/documentation/guides/versioning.
acceptNoThe default supported media type is application/json.
cache-controlNoBrave Search will return cached content by default. To prevent caching set the Cache-Control header to no-cache. This is currently done as best effort.
user-agentNoThe user agent originating the request. Brave Search can utilize the user agent to provide a different experience depending on the device as described by the string. The user agent should follow the commonly used browser agent strings on each platform. For more information on curating user agents, see RFC 9110.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesTop-level response discriminator. Always "locations" for Place Search.
queryNo
resultsNoArray of points-of-interest matching the search.
locationNoThe resolved search-area metadata, when available.

Implementation Reference

  • The main handler function that validates inputs, calls the Brave API's issueRequest with 'placeSearch' endpoint, validates the response, and returns structured content.
    export const execute = async (params: QueryParams) => {
      const parsedParams = RequestParamsSchema.parse(params);
      const parsedHeaders = RequestHeadersSchema.parse(params);
    
      const response = await API.issueRequest<'placeSearch'>(
        'placeSearch',
        parsedParams,
        parsedHeaders
      );
      const parsed = PlaceSearchApiResponseSchema.safeParse(response);
      const payload = parsed.success ? parsed.data : response;
    
      return {
        content: [{ type: 'text', text: JSON.stringify(payload) } as TextContent],
        isError: false,
        structuredContent: payload,
      };
    };
  • Registers the brave_place_search tool with the MCP server, linking its name, description, input/output schemas, and the execute handler.
    export const register = (mcpServer: McpServer) => {
      mcpServer.registerTool(
        name,
        {
          title: name,
          description: description,
          inputSchema: PlaceSearchInputSchema.shape,
          outputSchema: PlaceSearchApiResponseSchema.shape,
          annotations: annotations,
        },
        execute
      );
    };
  • Input validation schemas including request parameters (query, radius, count, coordinates, location, country, language, units, safesearch, spellcheck, geoloc) and request headers (api-version, accept, cache-control, user-agent).
    export const RequestParamsSchema = z.object({
      query: z
        .string()
        .trim()
        .max(400)
        .refine(
          (str) => str.length === 0 || str.split(/\s+/).length <= 50,
          'Query cannot exceed 50 words'
        )
        .transform((str) => (str.length === 0 ? undefined : str))
        .describe(
          'Query string to search for points of interest in an area. If no query is provided, the endpoint will return general points of interest in the given area.'
        )
        .optional(),
      radius: z
        .number()
        .min(0)
        .describe(
          'Search radius around the supplied coordinates, in meters. If omitted, the search is performed globally.'
        )
        .optional(),
      count: z
        .number()
        .int()
        .min(1)
        .max(50)
        .describe('Number of results to return. Maximum is 50. Default is 20.')
        .optional(),
      latitude: z
        .number()
        .min(-90)
        .max(90)
        .describe(
          'Latitude of the geographical coordinates around which to search, in degrees (-90 to 90). Typically paired with `longitude`.'
        )
        .optional(),
      longitude: z
        .number()
        .min(-180)
        .max(180)
        .describe(
          'Longitude of the geographical coordinates around which to search, in degrees (-180 to 180). Typically paired with `latitude`.'
        )
        .optional(),
      location: z
        .string()
        .trim()
        .min(1)
        .describe(
          "Location string to search around, used as an alternative to `latitude` and `longitude`. For US locations prefer the form '<city> <state> <country name>' (e.g. 'san francisco ca united states'); for non-US locations use '<city> <country name>' (e.g. 'tokyo japan'). No commas or special characters needed; capitalization does not matter."
        )
        .optional(),
      country: CountryCodesSchema.describe(
        "Two-letter country code (ISO 3166-1 alpha-2) used to scope the search. Defaults to 'US'."
      ).optional(),
      search_lang: SearchLangCodesSchema.describe(
        "Language for the search results. Defaults to 'en'."
      ).optional(),
      ui_lang: UiLangCodesSchema.describe(
        "User interface language for the response, usually of the form '<language>-<region>'. Defaults to 'en-US'."
      ).optional(),
      units: z
        .enum(['metric', 'imperial'])
        .describe("Units of measurement for distance values. Defaults to 'metric'.")
        .optional(),
      safesearch: z
        .enum(['off', 'moderate', 'strict'])
        .describe(
          "Safe search level for the query results. 'off' - No filtering. 'moderate' - Filter out explicit content. 'strict' - Filter out explicit and suggestive content. Defaults to 'strict'."
        )
        .optional(),
      spellcheck: z
        .boolean()
        .describe('Whether to apply spellcheck before executing the search. Defaults to true.')
        .optional(),
      geoloc: z.string().describe('Optional geolocation token used to refine results.').optional(),
    });
    
    export const RequestHeadersSchema = z.object({
      'api-version': z
        .string()
        .regex(/^\d{4}-\d{2}-\d{2}$/)
        .describe(
          'The API version to use. This is denoted by the format YYYY-MM-DD. Default is the latest that is available. Read more about API versioning at https://api-dashboard.search.brave.com/documentation/guides/versioning.'
        )
        .optional(),
      accept: z
        .enum(['application/json', '*/*'])
        .describe('The default supported media type is application/json.')
        .optional(),
      'cache-control': z
        .literal('no-cache')
        .describe(
          'Brave Search will return cached content by default. To prevent caching set the Cache-Control header to no-cache. This is currently done as best effort.'
        )
        .optional(),
      'user-agent': z
        .string()
        .describe(
          'The user agent originating the request. Brave Search can utilize the user agent to provide a different experience depending on the device as described by the string. The user agent should follow the commonly used browser agent strings on each platform. For more information on curating user agents, see RFC 9110.'
        )
        .optional(),
    });
    
    export const PlaceSearchInputSchema = z.object({
      ...RequestParamsSchema.shape,
      ...RequestHeadersSchema.shape,
    });
    
    export type PlaceSearchInput = z.input<typeof PlaceSearchInputSchema>;
    export type PlaceSearchQueryParams = z.infer<typeof RequestParamsSchema>;
    export type PlaceSearchRequestHeaders = z.infer<typeof RequestHeadersSchema>;
  • Output response schema defining the structure of the place search API response, including query metadata, array of POI results (with title, coordinates, address, opening hours, contact, rating, reviews, pictures, categories, timezone, etc.), and resolved location info.
    export const PlaceSearchApiResponseSchema = z.looseObject({
      type: z
        .literal('locations')
        .describe('Top-level response discriminator. Always "locations" for Place Search.'),
      query: QuerySchema.optional(),
      results: z
        .array(ResultSchema)
        .describe('Array of points-of-interest matching the search.')
        .optional(),
      location: LocationSchema.describe(
        'The resolved search-area metadata, when available.'
      ).optional(),
    });
    
    export type PlaceSearchApiResponse = z.infer<typeof PlaceSearchApiResponseSchema>;
  • The generic API request helper that routes 'placeSearch' to /res/v1/local/place_search, constructs query parameters and headers, fetches from Brave Search API, handles errors, and returns the typed response.
    async function issueRequest<T extends keyof Endpoints>(
      endpoint: T,
      parameters: Endpoints[T]['params'],
      requestHeaders: Endpoints[T]['requestHeaders'] = {} as Endpoints[T]['requestHeaders']
    ): Promise<Endpoints[T]['response']> {
      // TODO (Sampson): Improve rate-limit logic to support self-throttling and n-keys
      // checkRateLimit();
    
      // Determine URL, and setup parameters
      const url = new URL(`https://api.search.brave.com${typeToPathMap[endpoint]}`);
      const queryParams = new URLSearchParams();
    
      // TODO (Sampson): Move param-construction/validation to modules
      for (const [key, value] of Object.entries(parameters)) {
        // The 'ids' parameter is expected to appear multiple times for multiple IDs
        if (['localPois', 'localDescriptions'].includes(endpoint)) {
          if (key === 'ids') {
            if (Array.isArray(value) && value.length > 0) {
              value.forEach((id) => queryParams.append(key, id));
            } else if (typeof value === 'string') {
              queryParams.set(key, value);
            }
    
            continue;
          }
        }
    
        // Handle `result_filter` parameter
        if (key === 'result_filter') {
          /**
           * Handle special behavior of 'summary' parameter:
           * When 'summary' is true, we need to either set result_filter to
           * 'summarizer', or leave it excluded entirely. This is due to a known
           * bug in the now-deprecated Summarizer endpoint. Setting it to
           * 'summarizer' will result in no web results being returned, which is
           * not ideal. As such, we skip the parameter entirely.
           * See https://github.com/brave/brave-search-mcp-server/issues/272 and
           * https://bravesoftware.slack.com/archives/C01NNFM9XMM/p1751654841090929
           */
          if ('summary' in parameters && parameters.summary === true) {
            continue;
          } else if (Array.isArray(value) && value.length > 0) {
            queryParams.set(key, value.join(','));
          }
    
          continue;
        }
    
        // Handle `goggles` parameter(s)
        if (key === 'goggles') {
          const candidates = Array.isArray(value) ? value : [value];
          for (const candidate of candidates) {
            const normalized = normalizeGoggle(candidate);
            if (normalized !== null) {
              queryParams.append(key, normalized);
            }
          }
          continue;
        }
    
        if (value !== undefined && value !== null) {
          queryParams.set(key === 'query' ? 'q' : key, value.toString());
        }
      }
    
      // Issue Request
      const urlWithParams = url.toString() + '?' + queryParams.toString();
      const headers = new Headers(getDefaultRequestHeaders());
      for (const [key, value] of Object.entries(requestHeaders)) {
        if (value === undefined || value === null) continue;
        headers.set(key, String(value));
      }
    
      const response = await fetch(urlWithParams, { headers });
    
      // Handle Error
      if (!response.ok) {
        let errorMessage = `${response.status} ${response.statusText}`;
    
        try {
          const responseBody = await response.json();
          errorMessage += `\n${stringify(responseBody, true)}`;
        } catch (error) {
          errorMessage += `\n${await response.text()}`;
        }
    
        // TODO (Sampson): Setup proper error handling, updating state, etc.
        throw new Error(errorMessage);
      }
    
      // Return Response
      const responseBody = await response.json();
    
      return responseBody as Endpoints[T]['response'];
    }
    
    export default {
      issueRequest,
    };
Behavior3/5

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

The description implies a read-only operation ('Searches') but lacks details on rate limits, authentication, or side effects. The openWorldHint annotation suggests potential side effects, but the description does not address this. No contradiction, but limited transparency.

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?

The description is well-structured with a summary first, followed by usage guidelines and location format details. It is concise for the amount of information provided, with no unnecessary repetition.

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

Completeness4/5

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

Given the tool has 17 parameters and an output schema, the description provides sufficient context: it explains the result structure, location formatting, and count limits. It is complete enough for an agent to use effectively, though more guidance on parameter priorities could help.

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

Parameters4/5

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

All 17 parameters have descriptions in the schema (100% coverage). The description adds value by explaining the relation between latitude/longitude and location, providing location format examples, and noting count defaults (max 50, default 20). This goes beyond the schema.

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

Purpose5/5

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

The description clearly states the tool searches for POIs using Brave's Place Search API and lists the rich data fields returned (name, URL, address, hours, etc.). It distinguishes itself from siblings like brave_web_search by focusing on geographic place search with structured results.

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

Usage Guidelines4/5

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

The description provides explicit 'When to use' bullet points covering finding places near coordinates, browsing without query, building experiences, and augmenting answers. It also gives format guidance for location strings. However, it does not explicitly state when not to use or compare to siblings.

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/brave/brave-search-mcp-server'

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