# Connect CLI / any agent to looot

Install the looot CLI or call the REST API directly, so any agent that can run a shell command or an HTTP request can use looot.

## Setup

Setup installs the looot CLI and shows you the REST API directly, so any agent that can run a shell command or an HTTP request can use it.

Sign in, then /connect generates your actual prompt with a real token filled in -- this page shows the shape of that config, not a substitute for it.

## The six MCP tools

- `discover` -- Search the catalog by capability, not vendor name.
- `inspect` -- Read one operation's real contract, params, and version.
- `run` -- Execute an operation. Quoted, reserved, and settled once.
- `runs_get` -- Fetch one run's status and evidence by id.
- `runs_list` -- Page through this tenant's run history.
- `balance` -- Read remaining budget before spending it.

## For agents

The real per-tenant config comes from /connect after sign-in. This is the shape it fills in, with <YOUR_AGENT_TOKEN> standing in for the minted secret (`cs_ms_...`).

- **MCP endpoint**: https://api.looot.ai/mcp
- **Auth header**: Authorization: Bearer <token>
- **discover**: Search the catalog by capability, not vendor name.
- **inspect**: Read one operation's real contract, params, and version.
- **run**: Execute an operation. Quoted, reserved, and settled once.
- **runs_get**: Fetch one run's status and evidence by id.
- **runs_list**: Page through this tenant's run history.
- **balance**: Read remaining budget before spending it.

### install the CLI

```bash
curl -fsSL https://api.looot.ai/install.sh | sh
export COSET_API_URL=https://api.looot.ai
export COSET_LOCAL_TOKEN=<YOUR_AGENT_TOKEN>
```

### or call the REST API directly

```bash
curl -X POST https://api.looot.ai/v1/runs?wait=60 \
  -H "Authorization: Bearer <YOUR_AGENT_TOKEN>" \
  -H "content-type: application/json" \
  -d '{"endpointId":"ipinfo-lite","input":{"ip":"8.8.8.8"},"idempotencyKey":"first-run"}'
```

### prove it works

```bash
coset run ipinfo-lite --input '{"ip":"8.8.8.8"}' --wait 60
```
