Skip to content

Tools Reference

Pummelchen edited this page Sep 11, 2026 · 6 revisions

Tools Reference

Home · Installation · Compatibility · Tools Reference · Architecture · Providers · Configuration · Reliability · Security · Self-Hosting · Monitor · Testing · Troubleshooting · Project Tracker


The server exposes exactly three tools. Only concepts that map cleanly across every provider appear in the public schema; provider-specific options stay inside the adapters.

web_search

Search the public web and return ranked, deduplicated results with provenance.

Arguments

Name Type Required Default Notes
query string yes — Natural language or keywords
max_results integer no 8 1–20; clamped rather than rejected
recency enum no any any, day, week, month, year
include_domains string[] no — At most 20
exclude_domains string[] no — At most 20
locale string no — e.g. en-US, de-DE
provider enum no auto Force one provider
mode enum no balanced fast, balanced, thorough

Optional arguments are expressed as nullable types. Every declared property also appears in required, because strict consumers such as OpenAI require that; an optional field is written as ["string", "null"] and simply omitted by clients that are not strict. Defaults are documented in each description rather than declared with a default keyword, which strict consumers reject. See Compatibility.

provider accepts auto plus every selectable adapter id: tavily, brave, mojeek, exa, searxng, open_web_search, duckduckgo, startpage, parallel.

An explicitly requested provider is never silently substituted. If it is not configured, the call fails with an error naming it. Drop the argument to allow automatic selection.

Domain filters are enforced twice: they are passed to the provider where supported, and re-checked locally, so a provider that ignores a filter cannot leak excluded results.

Modes

Mode Provider fan-out Whole-search budget
fast one provider 12 s
balanced up to two independent providers, fused 15 s
thorough up to three, fused; an unattempted aggregator may be added if the result set is thin 20 s

Selection prefers independent crawler indexes, then other direct providers, then aggregators, then opt-in scrapers.

Response

Every result carries both a compact text rendering and structured content.

{
  "query": "swift 6.3 concurrency",
  "results": [
    {
      "rank": 1,
      "title": "Concurrency | Swift Documentation",
      "url": "https://swift.org/documentation/concurrency/",
      "snippet": "Swift concurrency documentation.",
      "published_at": null,
      "sources": ["tavily", "brave"]
    }
  ],
  "providers_used": ["tavily", "brave"],
  "providers_failed": [],
  "warnings": [],
  "retrieved_at": "2026-09-11T19:00:00.000Z",
  "elapsed_ms": 412,
  "served_from_cache": false
}
Field Meaning
results[].rank Position in the fused order
results[].sources Every provider that returned this URL, best-ranked first
providers_used Providers that contributed at least one result
providers_failed {provider, category, message} for each provider that failed
warnings Human-readable notes, including provider answers and thin-coverage hints
served_from_cache True when answered from the local cache

Text form:

[1] Concurrency | Swift Documentation
URL: https://swift.org/documentation/concurrency/
Snippet: Swift concurrency documentation.
Sources: tavily, brave

Partial failure

A search returns isError: false whenever at least one provider produced a usable result. Failed providers are listed in providers_failed and summarised in warnings. Only a total failure — or an invalid request — is an error.

web_open

Fetch one public URL and return readable text.

Arguments

Name Type Required Default Notes
url string yes — Absolute http/https only
max_characters integer no 12000 1000–50000

Extraction

  1. Native URLSession fetch, then SwiftSoup extraction that removes scripts, styles, navigation, footers and boilerplate, preferring <main> / <article>.
  2. If native extraction yields under 400 characters, or the fetch fails for a non-policy reason, the Jina Reader fallback renders the page remotely.
  3. If both fail, the original fetch error is reported — not a generic message.

The response records final_url (after redirects), status, content_type, title, extraction_method (raw_text, html_extraction, jina_reader), truncated, text_characters and warnings.

The readable text appears once, in the text content block; structuredContent carries the metadata and reports its length through text_characters. Duplicating it would roughly double the payload and push a large fetch towards the per-result ceilings some hosts enforce.

Security

web_open is an SSRF boundary: the URL comes from a model. Only public http/https addresses are fetchable, with lexical, DNS-resolution and per-redirect-hop validation. See Security.

web_search_status

Diagnostics for operators. Takes no arguments.

Reports per provider: status (ready, not_configured, disabled, circuit_open, probing, rate_limited), configured, source_family, is_aggregator, is_experimental_scraper, circuit state, request/success/failure counters, average latency, last error with category, and an actionable note explaining why an inactive provider is inactive. It also reports cache statistics and the resolved provider order.

It never exposes key material.

Errors

Failures are returned as tool results with isError: true and a message written for a human to act on. Stable categories:

Category Meaning Transient
not_configured No credentials or endpoint no
authentication Credentials rejected no
rate_limited Provider or local limiter yes
timeout Exceeded its budget yes
network Connection-level failure yes
server_error Upstream 5xx yes
malformed_response Body could not be parsed no
unsupported_request Provider cannot serve the request no
circuit_open Skipped after repeated failures no

Only transient categories count toward a provider's circuit breaker, so a bad key never hides behind an open breaker.

Example calls

Discover the current schema from the server rather than trusting a document:

{"jsonrpc":"2.0","id":2,"method":"tools/list"}
{"jsonrpc":"2.0","id":3,"method":"tools/call",
 "params":{"name":"web_search",
           "arguments":{"query":"swift concurrency","mode":"thorough","max_results":5}}}
{"jsonrpc":"2.0","id":4,"method":"tools/call",
 "params":{"name":"web_open",
           "arguments":{"url":"https://swift.org/documentation/concurrency/"}}}

Next steps

Clone this wiki locally