# Time in state — how long a project's open work sits in each state

`GET /api/v1/projects/{id}/metrics`

MCP tool: `get-project-metrics`

One row per `status`, readiness `state` and `on`, read back from the history of the project's work tasks: their status moves, every wait they were given and every `blocks` edge into them. `open` is how many are in that state at `until`, and `open_days` how long they have been; `entered` and `left` are how many times a task entered and left it during the window, and `left_days` how long each stayed. `moves` counts each pass from one state to another in the window, `to` a bare `status` when the task closed. `completed` is creation to completion for the tasks completed in the window. Days are nearest-rank percentiles, to one decimal; `null` where nothing was counted.

## Parameters

- `id` (path, required) — The project's `proj_…` id, as `list-projects` answers it.
- `since` (query, optional) — Start of the window `entered`, `left`, `moves` and `completed` count in. Defaults to 30 days before `until`.
- `until` (query, optional) — The instant `open` is taken at. Defaults to now.
- `tag` (query, optional) — Measures only tasks carrying any of these tags.
- `group_by` (query, optional) — `on`: also answer `groups`, the same rows per holder whose answer holds the work, a `user_…` or `team_…`, then `null` for an `external` wait on nobody. One of: on.

## Responses

- `200` — The project's time in state
- `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
