Skip to main content
Glama
Brave Search MCP Server

Brave Search MCP Server

Official
by brave

brave_llm_context

brave_llm_context
Read-onlyIdempotent

Retrieves relevance-ranked web page content, including text chunks, tables, code, and structured data, to ground AI answers and RAG pipelines without fetching pages manually.

Instructions

Retrieves pre-extracted, relevance-ranked web content using Brave's LLM Context API, optimized for AI agents, LLM grounding, and RAG pipelines. Unlike a traditional web search that returns links and short descriptions, this tool returns the actual substance of matching pages — text chunks, tables, code blocks, and structured data — so the model can reason over it directly.

When to use:
    - Grounding answers in fresh, relevant web content (RAG)
    - Giving an AI agent ready-to-use page content from a single search call
    - Question answering and fact-checking against current sources
    - Gathering source material for research without manually fetching pages
    - When you need the contents of pages, not just titles, descriptions, and URLs

When relaying results in markdown-supporting environments, cite the source URLs from the "sources" map.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "brave_llm_context"
  }
}

Input Schema

NameRequiredDescriptionDefault
countNoThe maximum number of search results considered to select the LLM context data. The default is 20 and the maximum is 50.
queryYesThe user's search query term. Query can not be empty. Maximum of 400 characters and 50 words in the query.
acceptNoThe default supported media type is application/json.
countryNoThe search query country, where the results come from. The country string is limited to 2 character country codes of supported countries.
gogglesNoGoggles act as a custom re-ranking on top of Brave's search index. The parameter supports both a url where the Goggle is hosted or the definition of the Goggle. Multiple goggle URLs and/or definitions can be provided in an array. For more details, refer to the Goggles repository (i.e., https://github.com/brave/goggles-quickstart).
freshnessNoFilters search results by when they were discovered. The following values are supported: 'pd' - Discovered within the last 24 hours. 'pw' - Discovered within the last 7 days. 'pm' - Discovered within the last 31 days. 'py' - Discovered within the last 365 days. 'YYYY-MM-DDtoYYYY-MM-DD' - Timeframe is also supported by specifying the date range e.g. 2022-04-01to2022-07-30.
x-loc-latNoThe latitude of the client's geographical location in degrees, to provide relevant local results. The latitude must be greater than or equal to -90.0 degrees and less than or equal to +90.0 degrees.
spellcheckNoWhether to enable spellcheck on the query.
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.
x-loc-cityNoThe generic name of the client city
x-loc-longNoThe longitude of the client's geographical location in degrees, to provide relevant local results. The longitude must be greater than or equal to -180.0 and less than or equal to +180.0 degrees.
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.
search_langNoThe search language preference. The 2 or more character language code for which the search results are provided.
x-loc-stateNoA code which could be up to three characters, that represent the client's state/region. The region is the first-level subdivision (the broadest or least specific) of the ISO 3166-2 code.
enable_localNoWhether to enable local recall. Not setting this value means auto-detect and uses local recall if any of the localization headers are provided.
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.
x-loc-countryNoThe two letter country code for the client’s country. For a list of country codes, see ISO 3166-1 alpha-2
x-loc-state-nameNoThe name of the client’s state/region. The region is the first-level subdivision (the broadest or least specific) of the ISO 3166-2 code.
x-loc-postal-codeNoThe client’s postal code
context_threshold_modeNoThe mode to use to determine the threshold for including content in context. Default is balanced.
enable_source_metadataNoEnable source metadata enrichment (site_name, favicon) in the sources attribute of the response.
maximum_number_of_urlsNoMaximum number of different URLs to include in LLM context.
maximum_number_of_tokensNoApproximate maximum number of tokens to include in context. The default is 8192 and maximum is 32768.
maximum_number_of_snippetsNoMaximum number of different snippets (or chunks of text) to include in LLM context. The default is 50 and maximum is 256.
maximum_number_of_tokens_per_urlNoMaximum number of tokens to include per URL. The default is 4096 and maximum is 8192.
maximum_number_of_snippets_per_urlNoMaximum number of snippets to include per URL. The default is 50 and maximum is 100.

Output Schema

NameRequiredDescriptionDefault
sourcesYesMetadata for each referenced URL, keyed by URL. Known fields include title, hostname, and age; site_name, favicon, and thumbnail are present when enable_source_metadata is true. Unknown fields are preserved as-is.
groundingYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.1.5
    • changedInput schema / properties / search_lang / enum
      Previous value: -[
      -  "ar",
      -  "eu",
      -  "bn",
      -  "bg",
      -  "ca",
      -  "zh-hans",
      -  "zh-hant",
      -  "hr",
      -  "cs",
      -  "da",
      -  "nl",
      -  "en",
      -  "en-gb",
      -  "et",
      -  "fi",
      -  "fr",
      -  "gl",
      -  "de",
      -  "el",
      -  "gu",
      -  "he",
      -  "hi",
      -  "hu",
      -  "is",
      -  "it",
      -  "jp",
      -  "kn",
      -  "ko",
      -  "lv",
      -  "lt",
      -  "ms",
      -  "ml",
      -  "mr",
      -  "nb",
      -  "pl",
      -  "pt-br",
      -  "pt-pt",
      -  "pa",
      -  "ro",
      -  "ru",
      -  "sr",
      -  "sk",
      -  "sl",
      -  "es",
      -  "sv",
      -  "ta",
      -  "te",
      -  "th",
      -  "tr",
      -  "uk",
      -  "vi"
      -]New value: +[
      +  "ar",
      +  "eu",
      +  "bn",
      +  "bg",
      +  "ca",
      +  "zh-hans",
      +  "zh-hant",
      +  "hr",
      +  "cs",
      +  "da",
      +  "nl",
      +  "en",
      +  "en-gb",
      +  "et",
      +  "fi",
      +  "fr",
      +  "gl",
      +  "de",
      +  "el",
      +  "gu",
      +  "he",
      +  "hi",
      +  "hu",
      +  "is",
      +  "it",
      +  "ja",
      +  "jp",
      +  "kn",
      +  "ko",
      +  "lv",
      +  "lt",
      +  "ms",
      +  "ml",
      +  "mr",
      +  "nb",
      +  "pl",
      +  "pt-br",
      +  "pt-pt",
      +  "pa",
      +  "ro",
      +  "ru",
      +  "sr",
      +  "sk",
      +  "sl",
      +  "es",
      +  "sv",
      +  "ta",
      +  "te",
      +  "th",
      +  "tr",
      +  "uk",
      +  "vi"
      +]
  2. Changed2 schema fields changedv2.1.3
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  3. Addedv2.0.66

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint and destructiveHint=false, so the safety profile is covered. The description adds genuinely new behavioral context by describing what comes back (text chunks, tables, code blocks, structured data) and by instructing the agent to cite URLs from the 'sources' map. It stops short of mentioning rate limits, auth requirements, or caching behavior.

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?

Purpose is front-loaded in the first sentence and the when-to-use list is easy to scan. There is mild redundancy among the bullets — 'Giving an AI agent ready-to-use page content from a single search call' and 'Gathering source material for research without manually fetching pages' restate the same benefit.

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?

An output schema exists, so return values need not be enumerated, yet the description goes further by characterizing the content types returned and the 'sources' citation pattern. For a 26-parameter tool it does not help the agent navigate the many optional pass-through parameters, though the schema fully covers those.

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 all 26 parameters (count, freshness, country, the maximum_number_of_* limits, etc.) are already fully self-documenting. The description adds no parameter-level guidance beyond an indirect reference to the 'sources' map, so the baseline of 3 applies.

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?

States a specific verb and resource ('Retrieves pre-extracted, relevance-ranked web content using Brave's LLM Context API') and explicitly contrasts the output with a traditional web search that returns links and short descriptions. An agent can immediately tell this apart from brave_web_search or brave_answers because the description names the differentiator: actual page substance versus links.

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?

Provides a dedicated 'When to use' list with five concrete scenarios (RAG grounding, agent-ready page content, fact-checking, research gathering, needing page contents over titles/URLs). It gives clear context for selection but never names a specific sibling tool such as brave_web_search as the fallback, leaving the agent to infer the alternative from the generic contrast.

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