{"url_pattern":"^https?://(www\\.)?bing\\.com(/.*)?$","site_name":"bing","allowed_domains":["bing.com"],"tools":[{"name":"bing_search","description":"Bing 搜索","inputSchema":{"type":"object","properties":{"query":{"type":"string","description":"Search query"},"count":{"type":"string","description":"Number of results (default 10)"}},"required":["query"]},"handler":"(params) => {\n  const run = async function(args) {\n\n      const query = args.query;\n      if (!query) return {error: 'query is required'};\n      const count = args.count || 10;\n\n      const url = 'https://www.bing.com/search?q=' + encodeURIComponent(query) + '&count=' + count;\n      const resp = await fetch(url, {credentials: 'include'});\n      if (!resp.ok) return {error: 'HTTP ' + resp.status};\n\n      const html = await resp.text();\n      const parser = new DOMParser();\n      const doc = parser.parseFromString(html, 'text/html');\n\n      const items = doc.querySelectorAll('li.b_algo');\n      const results = [];\n      items.forEach(li => {\n        const anchor = li.querySelector('h2 > a');\n        if (!anchor) return;\n        const title = anchor.textContent.trim();\n        const href = anchor.getAttribute('href') || '';\n        const snippet = (li.querySelector('p') || {}).textContent || '';\n        results.push({title, url: href, snippet: snippet.trim()});\n      });\n\n      return {query, count: results.length, results};\n  };\n  return run(params || {});\n}"}]}