brave_local_search_code_mode
Execute custom JavaScript on Brave local search results to return only the specific fields you need, reducing context usage.
Instructions
Performs a local search using Brave APIs, and then runs a custom JavaScript code string against the RAW API RESPONSE in a secure QuickJS sandbox. This reduces context window usage by only returning the output of your script. Use this for local/business lookups when you only need specific fields from large local payloads. Your script should read the 'DATA' global variable (a JSON string payload) and use console.log() to print the desired output.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | JavaScript code to execute against the 'DATA' variable. | |
| count | No | Number of results (1-20, default 5) | |
| query | Yes | Local search query (e.g. 'pizza near Central Park') | |
| language | No | Language of the code. Only 'javascript' is supported. | javascript |