---
name: web_search
description: When to use the Prismex API for fresh public-web information (REST or MCP), including auth and limits.
---

# Prismex

Use this skill when the user needs **up-to-date or niche information from the public web** that may not be in the model context: news, product pages, docs URLs, verification of facts, or filling gaps after a stated cutoff.

## When to use

- User asks for **current** events, prices, or page content that requires retrieval.
- You need to **cite sources** with real URLs for transparency.
- Internal or repo-only search is **not** enough; the task explicitly needs the **open web**.

## When not to use

- Answer is fully determined by **files already in the workspace** — read the repo first.
- User forbids network access or the environment has **no API key** — say so and offer offline alternatives.

## How to call (REST)

1. Ensure the host exposes `GET/POST /api/v1/search` and `WEB_SEARCH_API_KEYS` is set on the server.
2. Send:

   `Authorization: Bearer <key>` where `<key>` is one of the comma-separated keys in `WEB_SEARCH_API_KEYS`.

3. Prefer `GET` with `?q=` and optional `limit=` (1–25).

## How to call (MCP)

**Preferred (remote):** If the host exposes Streamable HTTP MCP at `{PUBLIC_BASE_URL}/mcp` (or `mcpStreamableHttpUrl` from `GET /api/public-config`), configure the client with `type: "streamableHttp"`, that URL, and `Authorization: Bearer <same API key as REST>`. Invoke tool **`web_search`** with `query` and optional `limit` / `count`.

**Optional (local stdio):** Run the adapter under `mcp/` with `WEB_SEARCH_BASE_URL` and `WEB_SEARCH_API_KEY` when the client cannot use streamable HTTP.

## Limits and behavior

- Results are **not** a full commercial SERP; the default backend uses a lightweight public API suitable for demos.
- For production, replace the backend with a contracted search provider and update **billing** docs accordingly.

## Command-line script (`scripts/search.py`)

Use the bundled Python script (stdlib only) with the same JSON body as the HTTP API:

`INSIGHTSEARCH_BASE_URL` and `INSIGHTSEARCH_API_KEY` are compatibility names retained for existing Prismex integrations.

```bash
export INSIGHTSEARCH_BASE_URL="https://your-host"
export INSIGHTSEARCH_API_KEY="psk_..."
python3 scripts/search.py '{"query":"example","count":10}'
```

Usage, parameters, examples, and the script file are on the product console **Skill 调用** page.

## Safety

- Do not exfiltrate user secrets in search queries.
- Respect robots/terms of upstream providers when swapping implementations.
