Search the web¶
Canonical tool: occam_search
Open-web search (query → result URLs). Default when OCCAM_SEARCH_PROVIDER is
unset: keyless DuckDuckGo HTML SERP with provider: "duckduckgo" disclosed in the
response. Occam does not index the web — it delegates discovery and names the source.
Override with OCCAM_SEARCH_PROVIDER=searxng | brave | tavily | donsetch
(plus URL/key/binary as required), or off / none for the air-gap
search_unconfigured contract. See configuration.
When to use¶
- No URLs yet → search, then feed
handleorurlinto probe / transcode / digest. - Each hit includes
id(S1…Sn, latest-search shorthand) andhandle(H…, durable in this MCP process for 60 minutes / 64 entries). A later search remapsS1— keephandleor the rawurlto retain a hit. - Discovering pages within one known site →
occam_mapis cheaper. rerank=trueprobes every hit and reorders so clean, HTTP-extractable pages rank above paywalls/anti-bot walls/JS stubs — worth the extra latency when you will transcode the winners.
Parameters¶
| Parameter | Type | Default | Required | Description |
|---|---|---|---|---|
query |
string | — | yes | Search query |
max_results |
int | 8 |
no | 1–20 |
rerank |
bool | false |
no | Probe each hit and sort by extractability; adds extractability (0–1) + recommendedBackend per result. Extra probe latency |
Returns¶
Success envelope:
ok: true,query,provider,countresults[]—{id, handle, title, url, snippet?}; withrerank=truealsoextractabilityandrecommendedBackend(a hit whose probe failed keeps a mid-low score and no backend annotation)handleTtlS(3600) andhandleScope(process) — once per success envelopeagentHints.suggestedNext— passhandleorurl;S1is the latest search only
Failure envelope: ok: false, query, failure: {code, message}.
Failure codes¶
invalid_arguments, search_unconfigured (provider off / incomplete explicit config),
search_timeout (retry or raise OCCAM_SEARCH_TIMEOUT_MS), search_http_<status>,
search_error (empty/blocked SERP or parse miss). See failure codes.
Example¶
Call (no env required after install):
Trimmed response:
{
"ok": true,
"query": "nginx rate limiting configuration",
"provider": "duckduckgo",
"count": 5,
"results": [
{ "id": "S1", "handle": "H00000001", "title": "Rate Limiting with NGINX", "url": "https://blog.nginx.org/…", "snippet": "…" }
],
"handleTtlS": 3600,
"handleScope": "process",
"agentHints": { "suggestedNext": "Pass result.handle or url to occam_transcode…" }
}
Related¶
- occam_probe — the scorer rerank uses, on demand for one URL
- occam_transcode / occam_digest — consume the results
- Configuration — provider setup