# Build & sell an AI agent on SeldonFrame — from your IDE

> SeldonFrame lets you **build, test, and sell an AI agent without leaving the
> editor you already live in.** Describe the agent in one sentence, run its
> evals, list it on the marketplace, and set a usage price. Listing is free —
> you only earn when someone runs it. No dashboard, no subscription, no human in
> the loop.

This file is a skill: `set up https://seldonframe.com/SKILL.md` and your agent
learns the whole flow below.

## Start here — you are the builder's guide

The moment you're connected, call **`get_workspace_state`** and read its
**`builder`** block. It tells you the builder's current rung on the build→sell
ladder and the ONE next action. **Follow the `builder` block. Ignore the
`counts` (contacts / bookings / deals) and the operator `next_steps` — those
are for SMB operators, not builders.** Your job is to help the human **build an
agent to SELL**, one rung at a time:

> **build → test → eval → list → price → observe & earn**

Move one rung at a time, narrate what each step does and what it costs or earns,
and don't touch the CRM tools unless the human explicitly asks. If
`get_workspace_state` returns **401**, the key didn't load into the MCP process
— tell the human to reconnect (`/mcp` → reconnect, or restart the IDE), then
retry.

## 1. Connect the SeldonFrame MCP

Add SeldonFrame as an MCP connector (Streamable HTTP) in your IDE — Claude Code,
Cursor, or Codex:

```
MCP server (Streamable HTTP): https://mcp.seldonframe.com/v1
Header: Authorization: Bearer <YOUR_KEY>
```

Claude Code, one line:

```bash
claude mcp add seldonframe --transport http https://mcp.seldonframe.com/v1 \
  --header "Authorization: Bearer <YOUR_KEY>"
```

**Then restart your IDE (or run `/mcp` → reconnect).** MCP connectors are read
at session start, so the SeldonFrame tools are NOT callable in the same session
you added them in — this is the #1 "why can't the agent see the tools" gotcha.
Reconnect first, *then* come back and ask your agent to build.

Once connected you get the SeldonFrame build/test/run/sell tools (`create_agent`,
`update_agent_blueprint`, `send_conversation_turn`, `run_agent_evals`,
`publish_agent`, `set_usage_price`, `tail_agent_conversations`,
`get_agent_metrics`, `list_my_listings`, `list_agents`, …).

## 2. Get a key

Your `<YOUR_KEY>` is a SeldonFrame workspace bearer token (it starts with
`wst_`). Mint and reveal it once at:

```
https://seldonframe.com/build/keys
```

The raw key is shown **exactly once** — store it in your secrets manager. It
encodes your workspace, so every MCP call is automatically scoped to you. Lost
it or leaked it? Revoke it from the same page and mint a new one. (First
workspace is free forever.)

## 3. Build an agent from one sentence

Just ask your agent — natural language is the input. For example:

> build me a 24/7 receptionist that answers calls, qualifies the lead, and books
> the job, then list it for $0.10 per call.

Under the hood your IDE agent calls:

- **`create_agent`** — turns the sentence into a full agent blueprint (surface,
  skill, tools, knowledge, guardrails, voice). One sentence in, a working agent
  out.
- **`update_agent_blueprint`** — refine the greeting, FAQ, tools, or guardrails.

## 4. Test it before you sell it

- **`send_conversation_turn`** — send the agent one live message and read its
  reply (and the tools it called). Try it like a customer before you publish.
- **`run_agent_evals`** — runs the agent's eval suite and returns a pass-rate
  summary with the judge's findings. Publishing a *live* agent is eval-gated, so
  fix what fails here first.

## 5. List it and set a usage price

- **`publish_agent`** — lists the agent on the SeldonFrame marketplace so
  buyers (and other agents over MCP) can discover and run it.
- **`set_usage_price`** — set how you charge. **Listing is free; this sets your
  price, it does not charge anyone.** You earn only on real, successful runs —
  SeldonFrame's only fee is a clean 5% on usage (you keep the rest), with no
  upfront cost. Models:
  - `per_call` — e.g. **$0.10 per call** → `set_usage_price({ listingId, model: "per_call", amountCents: 10 })`
  - `per_outcome` — e.g. **$10 per booking** → `set_usage_price({ listingId, model: "per_outcome", amountCents: 1000, outcomeType: "booking" })`

## 6. Observe & improve

- **`tail_agent_conversations`** / **`get_agent_conversation`** /
  **`replay_conversation`** — stream the logs of every real run, read a full
  transcript, or replay one to debug it.
- **`get_agent_metrics`** — per-agent conversations, eval pass-rate, validator
  pass-rate, and health at a glance.
- **`list_my_listings`** — your listings with installs, runs, and net earnings
  (after the clean 5% usage fee).
- **The Brain learns.** Every run is logged, and the eval findings plus your
  edits become lessons (`write_brain_note` / `read_brain_path`) that are
  recalled into your next `create_agent` — so each agent you build is a little
  smarter than the last.

## 7. Run anything in the catalog: discover → inspect → run

The same MCP key lets you RUN what's already on the marketplace — whole **agents**
AND single **tools** (1000+ connected actions) — through one consistent
flow. Every sellable thing is discovered, priced, and run the same way:

- **discover** — natural-language search → ranked results, each with its price:

  ```
  POST https://seldonframe.com/api/v1/build/discover
  { "query": "send an email to a customer", "limit": 5 }
  → { "results": [ { "id", "type": "agent"|"tool", "provider?", "name",
                     "description", "price": { "type", "amountCents" }, "score" } ] }
  ```

- **inspect** — the input schema + pricing + docs, so you know how to call it:

  ```
  POST https://seldonframe.com/api/v1/build/inspect
  { "type": "tool", "id": "GMAIL_SEND_EMAIL" }
  → { "id", "type", "name", "description", "inputSchema", "price", "docUrl?" }
  ```

- **run** — execute with structured input; get the result back inline:

  ```
  POST https://seldonframe.com/api/v1/build/run
  { "type": "agent", "id": "ace-receptionist", "input": { "message": "Do you do emergency calls?" } }
  → { "runId", "status": "completed", "output", "price",
      "billing": { "calculatedCost", "amountCents", "charged": false } }
  ```

  An agent is run by sending it a `message`; a tool is run with the arguments
  its `inputSchema` describes. **A run returns its `calculatedCost` (the
  cost is recorded) but is NOT charged yet — a prepaid wallet draws it down in a
  later phase.** Errors are never billed (only successful runs accrue).

---

## The one-paragraph flow

`set up https://seldonframe.com/SKILL.md` → add the MCP connector with a
`wst_` key from `/build/keys` → *"build me a 24/7 receptionist and
list it for $0.10/call"* → `create_agent` → `run_agent_evals` →
`publish_agent` → `set_usage_price`. Build, test, list, price — without ever
opening a dashboard. And to USE the catalog: **discover** → **inspect** →
**run** any agent or tool, each priced, the cost recorded (not charged in P1).

Human-browsable quickstart: https://seldonframe.com/build
