Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
"introduction/create",
"introduction/control",
"introduction/observe",
"introduction/scale"
"introduction/scale",
"search"
]
},
{
Expand Down
2 changes: 2 additions & 0 deletions reference/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ title: "Kernel CLI"

The Kernel CLI helps you access and manage your Kernel resources.

For web search from your terminal, use the [Search API examples](/search). CLI releases that include Search also support `kernel search`; otherwise, use the HTTP examples.

## Installation

```bash
Expand Down
4 changes: 4 additions & 0 deletions reference/mcp-server/tools/search-docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ description: "Search Kernel platform documentation and guides"

Search Kernel platform documentation for guides, tutorials, and API references. Use it when you need to understand how Kernel features work or to troubleshoot issues.

<Note>
This tool searches Kernel documentation, not the web. The [Search API](/search) is a separate HTTP API; web search support depends on the hosted MCP server release and your organization's Search access. When available, the `web_search` tool is exposed from the Search entitlement. MCP entitlement snapshots are cached per credential and connection for up to 30 minutes; the Search API remains authoritative when a search runs.
</Note>

## Parameters

| Parameter | Description |
Expand Down
97 changes: 97 additions & 0 deletions search.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
title: "Search"
description: "Search the web through Kernel's HTTP API and discover provider capabilities."
---

Search the web with `POST /search`. Kernel routes your query to a configured search provider and returns normalized results, provider attempt history, and warnings.

<Note>
Search requires access to be enabled for your organization. A `404` with code `search_disabled` means your organization doesn't have access. Contact Kernel to request access. Provider availability depends on the service configuration.
</Note>

## Run a search

Create an [API key](/info/api-keys) and set `KERNEL_API_KEY` in your environment. These examples use HTTP directly, so they don't require a particular Kernel SDK version.

<CodeGroup>
```bash cURL
curl --fail-with-body https://api.onkernel.com/search \
-H "Authorization: Bearer $KERNEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"Playwright browser automation","max_results":5}'
```

```typescript TypeScript
const response = await fetch("https://api.onkernel.com/search", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.KERNEL_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
query: "Playwright browser automation",
max_results: 5,
}),
});
if (!response.ok) throw new Error(await response.text());
const search = await response.json();
console.log(search.results);
console.log(search.warnings);
```

```python Python
import json
import os
from urllib.request import Request, urlopen

request = Request(
"https://api.onkernel.com/search",
data=json.dumps({
"query": "Playwright browser automation",
"max_results": 5,
}).encode(),
headers={
"Authorization": f"Bearer {os.environ['KERNEL_API_KEY']}",
"Content-Type": "application/json",
},
method="POST",
)
with urlopen(request) as response:
search = json.load(response)
print(search["results"])
print(search["warnings"])
```
</CodeGroup>

If your installed CLI release includes Search, the equivalent command is:

```bash
kernel search "Playwright browser automation" --max-results 5
```

Inspect `results` for ranked URLs, titles, and descriptions. Check `warnings` for parameters that were approximated or omitted, and `attempts` for provider execution history. Save the response if you need it beyond its `expires_at` timestamp; `GET /search/{id}` retrieves retained results, not a fresh search.

## Discover providers and filters

Use discovery rather than assuming a provider is available:

```bash
curl --fail-with-body https://api.onkernel.com/search/providers \
-H "Authorization: Bearer $KERNEL_API_KEY"
```

The response describes configured providers, their filter and content capabilities, and provider-native option schemas. Omitting `strategy` uses automatic routing, which is the recommended default. Provider-specific strategies and native options are advanced features; review the applicable provider availability and terms before using them.

Portable parameters include `max_results`, `country`, `language`, `include_domains`, `exclude_domains`, `recency`, `start_date`, `end_date`, and `safe_search`. Support varies by provider. Set `strict_params: true` when supplied portable parameters must be honored exactly; otherwise, inspect warnings for unsupported or approximated values. Domain and safety filters aren't authorization boundaries.

## Content retrieval limits

Some providers support inline content. Check provider discovery before requesting it. Don't assume a result includes full page text or that every provider supports the same content options.

Deferred retrieval through `POST /search/{id}/contents` isn't available yet and returns `404`. Its presence in the API schema doesn't indicate that it is ready to use.

## CLI and MCP access

The current released Kernel CLI might not include `kernel search` yet. If your installed release includes it, use the CLI example above; otherwise, use the HTTP examples with an API key. `kernel login` isn't required for HTTP requests.

The hosted Kernel MCP server exposes [`search_docs`](/reference/mcp-server/tools/search-docs) for Kernel documentation. Web Search API support is a separate MCP capability and depends on the server release and your organization's Search access. In releases that include it, `web_search` appears only when the Search entitlement is enabled. The MCP server checks entitlements when listing tools or calling an entitlement-gated tool and caches the snapshot per credential and connection for up to 30 minutes. The Search API remains authoritative when a search runs, so visibility can lag an entitlement change within an existing connection.
Loading