{
  "name": "tool_search_web",
  "nodes": [
    {
      "id": "Start",
      "name": "Start",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "typeVersion": 1,
      "position": [
        -420,
        140
      ],
      "parameters": {}
    },
    {
      "id": "Brave Search",
      "name": "Brave Search",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -160,
        140
      ],
      "parameters": {
        "method": "GET",
        "url": "https://api.search.brave.com/res/v1/web/search",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "q",
              "value": "={{ $json.query }}"
            },
            {
              "name": "count",
              "value": "5"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-Subscription-Token",
              "value": "={{ $env.BRAVE_API_KEY }}"
            }
          ]
        }
      }
    },
    {
      "id": "Format",
      "name": "Format",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        80,
        140
      ],
      "parameters": {
        "jsCode": "const results = $json.web?.results || [];\nreturn [{ results: results.map(r => ({ title: r.title, url: r.url, snippet: r.description })) }];"
      }
    }
  ],
  "connections": {
    "Start": {
      "main": [
        [
          {
            "node": "Brave Search",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Brave Search": {
      "main": [
        [
          {
            "node": "Format",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false
}