# For agents

If you are an AI agent working for a person: this page says what you can do in Tendbrook on your own, what
waits for your principal, what it costs, and how it fails. It's generated from the platform's own tool list.

## Getting in

- **MCP:** `https://api.tendbrook.com/mcp` (Streamable HTTP). **REST:** `https://api.tendbrook.com/v1`, spec at [https://www.tendbrook.com/openapi.json](https://www.tendbrook.com/openapi.json).
- **Credentials:** an API key your principal creates in Settings → API keys (`Authorization: Bearer ec_live_…`).
  The key never has more access than the person who made it. Guides per client: [quickstarts](https://www.tendbrook.com/docs/quickstart).
- **No key yet?** Create a sandbox: `ec sandbox create --host https://api.tendbrook.com` (or `POST /v1/sandbox` with a solved sign-up
  challenge) gives you a sandbox organization and a limited key at once: agent scopes, 60 requests a minute, 7
  days, and nothing sent outside until a person claims it.
- **Free plan:** unlimited people, 500 AI credits a month for optional summaries (a hard cap), no card ([pricing](https://www.tendbrook.com/pricing), [pricing.json](https://www.tendbrook.com/pricing.json)).

## Working with childcare data

- **Read what the scopes allow:** rooms, programs, schedules and reports as the childcare tools arrive (coming).
- **Children's records are off by default:** names, photos, medical and custody notes are behind their own scope, off
  for every key and assistant until an owner turns it on for that one. Custody documents are never available to keys.
- **Propose, don't send:** anything that would message a family or write to another system waits for a person, and
  every kind of family message stays off until the organization turns it on.

## Two ways in, two sets of rules

- **Your own key's tools** (`ec_api` and the rest) act at once, with your key's scopes, like a person in the app.
  They're for the edits your principal asked you to make.
- **`ec_propose`** runs one platform tool the way an agent does, through the organization's policy. An MCP request
  counts as outside content, so the strictest rules apply. The lists below are the policy engine's own answer for
  each tool, called this way.

## What runs at once through ec_propose

4 of the 8 platform tools: reads and reasoning inside Tendbrook, and writes that stay inside it
(notices to teammates). A write that reaches outside is marked. Call them only for what your principal asked.

- `team.notice`: Notify teammates (notifies a teammate at once)
- and these reads: `kb.read`, `sandbox.run`, `workspaces.list`

## What waits for a person

These wait in the approval inbox, and `ec_propose` returns the approval's link for your principal: anything that
reaches outside (web pages, other MCP servers, the browser), sends, and changes to existing records.

- `http.get`: Fetch a URL (reads outside Tendbrook)
- `http.send`: Send to a URL (sends outside Tendbrook)
- `mcp.read`: Read from a connected MCP server (reads outside Tendbrook)
- `sandbox.run_net`: Run code (allowlisted network) (reads outside Tendbrook)

Approving is never possible through the API or MCP: it happens in the web app. See
[approvals and policy](https://www.tendbrook.com/docs/approvals).

## What it costs

| Unit | Tendbrook | Notes |
|---|---|---|
| An API or MCP call | No charge per call | Rate-limited (below) |
| AI work (summaries, drafts, agent runs) | $0.03 per credit (1,000 for $30) | Each run's trace shows its cost; a dry run (`ec_runs_start` with `dry_run: true`) shows the plan first |
| A plan | Small center $24.17, Center $40.83, Group $37.50 a month per organization, billed annually | Not per seat; agents aren't seats |

## Paying

You can't pay, and you don't need to. Paid plans aren't open yet: every organization is on Free, and nothing can be
charged. When they open, an owner chooses a plan in the app; nothing is bought without them. Machine
payments (x402, agent payment tokens) aren't accepted: a person always pays.

## Limits and errors

- **Rate limit:** per key, published in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. Past
  it you get 429 `rate_limited` with `Retry-After` (seconds): wait that long, then retry.
- **Errors** are `{ "error": { "code", "message", "fix", "docs" } }`: the cause, what to do, and a link to its
  section of [the errors page](https://www.tendbrook.com/docs/errors).
  - `bad_request` (400): the input didn't validate; `details.issues` lists each field and what's wrong. Fix the
    input and send it again.
  - `unauthorized` (401): no key or a bad one. Ask your principal for a key from Settings → API keys.
  - `forbidden` (403): the key lacks the scope named in the message, or the route is for the web app only.
  - `not_found` (404), `conflict` (409, for example a stale `version`: read the record again), `gone` (410).
  - `policy_blocked` (422): the organization's policy refused it (the kill switch, a spending ceiling). Don't
    retry: tell your principal which rule.
  - `unavailable` (503): retry after a short wait.
- Destructive calls need `confirm: true`.

## A snippet for AGENTS.md, CLAUDE.md or Cursor rules

```markdown
## Tendbrook (Child care center and home daycare software)
- MCP server: https://api.tendbrook.com/mcp with `Authorization: Bearer $EC_API_KEY` (never write the key into a file).
- Start with ec_whoami to see the organization and scopes.
- Read freely. Your key's own tools (ec_api…) act at once: use them only for what the user asked.
- For publishes, outside requests and changes the user didn't ask for, use ec_propose: they wait for a person's approval. Never try to approve.
- On 429, wait Retry-After seconds. On policy_blocked, stop and report the rule to the user.
- Docs: https://www.tendbrook.com/docs (every page also as .md); tools: https://www.tendbrook.com/docs/mcp/tools.
```
