Skip to content

Enhance Brave Search Tool with Custom Goggle Support #1650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kdenhartog
Copy link

@kdenhartog kdenhartog commented May 2, 2025

Description

  • Added optional 'goggles' parameter to the web search tool for custom re-ranking using Brave Goggles.
  • Updated input schema to include 'goggles' as an array of strings.
  • Implemented logic to merge default goggles from the environment variable with user-provided goggles.
  • Enhanced README documentation to explain the usage of goggles and how to set them via environment variables.

Server Details

  • Server: Brave
  • Changes to: Add support of the usage of Goggles

Motivation and Context

This allows a user of the Brave Search API to modify the results ordering such that they can prioritize specific query results. This will allow them to better fine tune the context supplied when relying on this MCP server.

How Has This Been Tested?

Tested this with MCP inspector to make sure query results match what's expected. The easiest way to do this is to use the query "rusty nail" and notice without goggles the top results aren't programming related. Then once it's enabled they change to be rust programming related. The search results will match what happens when the rust programming goggle is used on https://search.brave.com also.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

- Added optional 'goggles' parameter to the web search tool for custom re-ranking using Brave Goggles.
- Updated input schema to include 'goggles' as an array of strings.
- Implemented logic to merge default goggles from the environment variable with user-provided goggles.
- Enhanced README documentation to explain the usage of goggles and how to set them via environment variables.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant