# Tools

The exchange can run a tool for a model or an MCP client. The router lists only tools that it can run now.

## List the tools

`GET /v1/tools` needs no credential. The response gives the request type, input schema, price and call limit.

```bash
curl https://router.inference.ai.exchange/v1/tools
```

The live Markdown list is at [tools.md](https://liquidinference.ai/tools.md).

## Web search

`architect:web_search` searches the web for current facts. The input needs a `query` string.

## Read URL

`architect:read_url` reads one web page. The input needs an HTTP or HTTPS `url` string.

## Let a model call a tool

Add the tool type to a Chat Completions request. The router runs the call before it returns the final answer.

```json
{
  "model": "architect.auto",
  "messages": [{ "role": "user", "content": "What changed today?" }],
  "tools": [{ "type": "architect:web_search" }]
}
```

The router refuses a tool type that it cannot run. List the tools again if availability changes.

A request with `stream: true` works, and the answer arrives as a stream. The router runs the tool calls first and then sends the answer of the last step, so the first token comes after the whole loop.

The Responses and Messages APIs have a hosted search tool, `web_search` and `web_search_20250305`. The router runs `web_search` for either one, and writes the answer in the API that you used.

A client that can set only the model name, such as a coding harness, can add `:web` or `+web` to it, as in `architect.auto:smartest+web`. That names the `web_search` tool. The model decides whether to search, and a call is charged at the price of the tool. A router that cannot run the tool refuses the name with `400 unsupported_parameter`.

## Use MCP

Architect MCP has two tools for this service:

- `list_tools` reads the public catalogue.
- `call_tool` runs one tool and charges the workspace.

The `call_tool` tool needs `mcp:spend`. Send the same `idempotency_key` when you retry one call.

## Call a tool over HTTP

`POST /v1/tools/{tool}` runs one tool. Send a spend key and an `Idempotency-Key` header.

```bash
curl https://router.inference.ai.exchange/v1/tools/web_search \
  -H "Authorization: Bearer $INFERENCE_API_KEY" \
  -H "Idempotency-Key: search-1" \
  -H "Content-Type: application/json" \
  -d '{"arguments":{"query":"Architect Inference"}}'
```

The response gives the tool result and the charge in nano-USD. A failed tool call does not charge the workspace.

Each tool has a daily cap for each key, which `GET /v1/tools` shows as `daily_calls_per_key`. A call past the cap gets `429` with `tool_daily_cap_reached`, and it charges nothing. A call with no key counts against its workspace.
