> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magpiedb.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Magpie is a trace store for AI agents, used as a library (crate `magpiedb`, npm `magpiedb`, PyPI `magpiedb`) or as `magpie-server`, which takes OpenTelemetry (OTLP over HTTP on 127.0.0.1:4318 and gRPC on 127.0.0.1:4317 by default).
> Use only the commands, flags, routes and JSON shapes that these pages show. Do not guess a flag or a query field: if a page does not show it, say that the docs do not show it.
> Install the library with `cargo add magpiedb`, `npm install magpiedb` or `pip install magpiedb`. Get the server from the GitHub Releases download or the Docker image `ghcr.io/intojhanurag/magpie-server`, as the quick start shows.
> Only one process may write to a store folder at a time. For many apps, send traces to one `magpie-server`.
> `magpie-server doctor` checks a running server. An AI agent can query the traces over MCP at `/mcp` on the HTTP port (page guides/mcp).

# Storage, mask counts and health

> GET /v1/storage, GET /v1/mask and GET /healthz: the size of the store, what the mask policy replaced, and whether the server takes writes.

Three small routes for operators and dashboards.

```sh Request theme={null}
curl -s localhost:4318/v1/storage
```

```json 200 theme={null}
{"diskBytes":74402,"mode":"local","spans":7,"traces":3}
```

## Get the store size

`GET /v1/storage` tells where the store is and how big it is. Right: `read`. With tenants: the store of the request's tenant.

**mode** `string`

`"local"` for a store on the disk. With `--s3`, the answer also has the state of the uploader or of the reader: see [the server and S3](https://docs.magpiedb.com/reference/server-s3.md).

**spans** `integer`

**traces** `integer`

**diskBytes** `integer`

## Get the mask counts

`GET /v1/mask` tells what the mask policy (`--mask`) replaced since the store opened. It gives counts only: no value. Right: `read`.

**enabled** `boolean`

`false`: the server has no mask policy.

**rules** `object[]`

One row per rule, in the order of the policy: `{"name", "masked"}`, where `masked` is the number of matches replaced.

**droppedAttributes** `integer`

Attribute values that `dropAttributes` removed.

With tenants, the counts are of the tenant's store. A store that closed (idle, or `--max-open-tenants`) starts at 0 again. How to write a policy: [Masking](https://docs.magpiedb.com/reference/mapping-cost-masking.md#masking).

## Check health

`GET /healthz` needs no key.

| Answer | When |
| - | - |
| `200` `ok` | The server takes writes. A server that is read-only by its flags also says `ok`. |
| `503` and one line of text | The server refuses writes: `writes are refused: the disk is nearly full` or `writes are refused: the store cannot write` ([A full disk](https://docs.magpiedb.com/operations/disk-full.md)). Queries can still answer. |

> [card] [Run in production](https://docs.magpiedb.com/operations/overview.md)
>
> Health checks, keys, backups and upgrades.

> [card] [HTTP API](https://docs.magpiedb.com/reference/http-api.md)
>
> Every route and the right it needs.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.