# Reading a document in parts

Walking a large document part by part: the range a conversion reports, the headers carrying it, and `part=N`.

A conversion self-describes its part range, so a large document can be walked part by part without converting it again. The two headers are on every response; the same pair sits in the JSON body under `parts`.

| Field                              | Meaning                                                                                                                                                               |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `parts.count` / `X-MDAPI-Parts`    | How many parts the document has - the range `part` accepts                                                                                                            |
| `parts.unit` / `X-MDAPI-Part-Unit` | What a part is: `page`, `slide`, `sheet`, `chapter`, or `a4` (one A4 sheet of text)                                                                                   |
| `parts.listed`                     | A book's inventory, in document order. It can name more entries than `parts.count`: a clamped book keeps its whole listing, so the tail is listed but not addressable |
| `parts.truncated`                  | The document was cut while it was built (archive entry cap or output budget). Present only when true                                                                  |
| `parts.names` / `parts.sizes`      | `result=meta` only: the title of each part, and its size in chars, tokens and bytes - what fits a context window, reported before the content itself is fetched       |

`result=meta` reports the same range before anything is converted - ask for it first when the size of the answer matters more than the answer.

The unit is decided by the format, not chosen by the caller:

| Unit      | Formats                                                                                                                        | What one unit is                                                                                                                                                                                                     |
| --------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `page`    | PDF                                                                                                                            | One page. Every page carries its own heading, so a page range is a part range                                                                                                                                        |
| `slide`   | Presentations (PPTX, PPT, POT, PPS, ODP)                                                                                       | One slide, in document order                                                                                                                                                                                         |
| `sheet`   | Spreadsheets (XLSX, XLS, XLSM, XLSB, ODS, ET, Numbers, DTA)                                                                    | One sheet, carrying its own name as the heading                                                                                                                                                                      |
| `chapter` | Books - EPUB and the archives (ZIP, TAR, 7z, and the compression family once it is unwrapped)                                  | One entry of the book. `.tar.zst`, `.tar.xz`, `.tar.bz2` and `.tar.gz` expand to the same book as a plain `.zip`, and so does a compressed file opened from a data URI - one entry, one unit, whatever the transport |
| `a4`      | Anything else with a text layer and no natural boundary - DOCX, DOC, ODT, RTF, text and code, CSV/TSV, JSON/YAML, HTML, images | One A4 sheet of text: 2500 characters, the density of a page at 12pt. It is also the fallback when a format has a boundary of its kind but its markdown carries none, so `parts.unit` is always the truth to read    |

A part carries the document's front matter in front of it - the title, the metadata block and a book's `## Contents` listing, everything before the first unit - so a single part is readable on its own, without a second request for the context. This is what `parts.sizes` measures: each size is what `part=N` alone returns, front matter included, so the sizes add up to a little more than the whole document rather than exactly to it. A part of an A4 document has no front matter to carry and gets a generated `## Part N` heading instead.

## Links

- **About service:** https://mdapi.io/about
- **API documentation and conversion:** https://mdapi.io
- **MCP server manifest:** https://mdapi.io/mcp
- **Health check:** https://mdapi.io/health
- **Documentation index:** https://mdapi.io/llms.txt
- **Full API documentation:** https://mdapi.io/llms-full.txt
- **AI discovery:** https://mdapi.io/.well-known/ai-discovery.json or https://mdapi.io/ai-discovery.json
- **AI Agent discovery:** https://mdapi.io/.well-known/agent.json or https://mdapi.io/agent.json
- **A2A Agent card:** https://mdapi.io/.well-known/agent-card.json or https://mdapi.io/agent-card.json
- **ACP manifest:** https://mdapi.io/.well-known/acp.json or https://mdapi.io/acp.json
- **x402 payment manifest:** https://mdapi.io/.well-known/x402.json or https://mdapi.io/x402.json
- **OpenAPI specification (JSON):** https://mdapi.io/.well-known/openapi.json or https://mdapi.io/openapi.json
- **OpenAPI specification (YAML):** https://mdapi.io/.well-known/openapi.yaml or https://mdapi.io/openapi.yaml
- **MAPI specification:** https://mdapi.io/.well-known/mapi.md or https://mdapi.io/mapi.md
- **Skill specification:** https://mdapi.io/.well-known/skill.md or https://mdapi.io/skill.md
- **Agent Plugins manifest:** https://mdapi.io/.well-known/plugin/plugin.json or https://mdapi.io/.well-known/plugin.json
- **Agent Plugins MCP config:** https://mdapi.io/.well-known/plugin/mcp.json
- **Agent Plugins conversion skill:** https://mdapi.io/.well-known/plugin/skills/mdapi-conversion/SKILL.md
- **API documentation pages:** https://mdapi.io/docs

## External Links

- **github.com** https://github.com/mdapiio/mdapi.io
- **skills.sh** https://www.skills.sh/mdapiio/mdapi.io
- **skillsmp.com** https://skillsmp.com/creators/mdapiio/mdapi.io
- **clawhub.ai** https://clawhub.ai/mdapiio
- **x.com** https://x.com/mdapiio

## Disclaimer

**The service is provided "AS IS".**


> mdapi.io is an edge-native service-transport primitive for AI, autonomous-agents, and the Web4 ecosystem.
