# The ready set, ranked — or any slice of open work you ask for

`GET /api/v1/next`

MCP tool: `get-next`

The ready set — `active` tasks nothing holds — ranked by `priority`, then `unblocks` (how many open tasks each frees), then the oldest `review_due_at`. With no `slice`, `status` or `state` it answers one task, the next action: give the person that one, not a list. To divide work among agents, ask `limit` for as many as you will start; `total` says how many matched. Goals (`kind: project`) appear only in `slice=review`.
**Every answer carries `counts`**: how many tasks `slice=review`, `hold_cleared`, `date_came`, `active_held` and `waiting_on_me` would list under the same filters. Read them at the start of a run and ask for each slice that is not 0: `review` is what a week (a month for `incubated` and `reference`) without a write or a confirmation left due, the three drifts are where status and readiness disagree, and `waiting_on_me` is what waits on the person. Propose the moves they call for; never make them.
After an absence, in order: `slice=risks`, `deadlines`, `waiting`, `blocked`, then no filter. Nothing here reads the inbox.

## Parameters

- `project` (query, optional) — Only these `proj_…` ids (repeat or comma-separate); omit for all of yours. One you are not a member of answers `404`.
- `tag` (query, optional) — Only tasks carrying any of these tags.
- `upstream_of` (query, optional) — Only this task and the open work before it: every task that `blocks` it, transitively, stopping at a closed one — what is left before a milestone. Composes with the other filters; a task you cannot see answers `404`.
- `slice` (query, optional) — A question by name instead of its filters. `risks`: `active`, `waiting`, `calendar` and `blocked` tasks with a priority and a review due. `deadlines`: `calendar`, soonest date first. `waiting`, `blocked`: that status. `waiting_on_me`: every open task with a wait `on` you or your teams, whoever holds it. `review`: due reviews, oldest first. `hold_cleared`: waiting or blocked, and nothing holds it. `date_came`: on the calendar, and the date came; for both, run the check the wait states, else propose `active`. `active_held`: active and held, expected behind an earlier wave, a stale hold otherwise. Filters beside it narrow it (`slice=hold_cleared&status=blocked` is the blocked half); an explicit `sort` replaces its own. One of: risks, deadlines, waiting, blocked, hold_cleared, date_came, active_held, review, waiting_on_me.
- `status` (query, optional) — Only these open statuses (repeat or comma-separate); a closed task is never next.
- `state` (query, optional) — Only these computed readiness states.
- `priority` (query, optional) — Only these levels; `none` is the tasks nobody prioritised.
- `kind` (query, optional) — Only these kinds; absent, every kind but `project`. A `decision` waits on whoever decides: ask `status=waiting` or `slice=waiting_on_me` for one.
- `review_due` (query, optional) — `true`: only tasks whose `review_due_at` has passed.
- `sort` (query, optional) — `rank` (the default): the description's ranking. `review_due_at`: the longest overdue review first. `until`: the soonest `scheduled` date first, a passed one before all; undated tasks last. A tie falls back to `rank`. One of: rank, review_due_at, until.
- `assignee` (query, optional) — Whose work: `me` (you and your teams), `none` (untaken), a `user_…` or `team_…`, or `any`. Defaults to `none,me`: never another's.
- `limit` (query, optional) — Defaults to 1 for the ready set and 10 otherwise. Ask for more when the person asks to choose, to divide work among agents, or in a review slice.

## Responses

- `200` — The tasks the query asked for, ranked
- `400` — The query string does not match the operation's schema
- `404` — No such task, or a `project` naming one this caller is not a member of
