# Rtf inspect

`rtf-inspect` · version 1.0.0 · Other utilities · free, no key needed

Inspect an 8 KiB ANSI-1252 RTF text subset: paragraphs, omitted destinations, pictures, objects and warnings.

**Use when you need to: inspect rtf fragment structure · count rtf text paragraphs · list omitted rtf destinations.**

## Decide before calling

Read the [versioned contract](/v1/tools/rtf-inspect/versions/1.0.0) and the supported scope below. Reuse `rtf-inspect@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `rtf-inspect@1.0.0` for inspect rtf fragment structure. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- inspect rtf fragment structure
- count rtf text paragraphs
- list omitted rtf destinations
- count rtf picture and object groups
- inspect ansi rtf subset warnings
- summarize base64 rtf text fragment

## Not supported

- general Word-produced RTF with font/layout/field controls
- non-1252 code pages, binary data or surrogate Unicode
- rendering, macros and external resources
- count words in RTF text

## Behavior

- Canonical standard padded Base64, no extra fields. Encoded<=10924 and decoded1..8192 bytes. Only strict ANSI1252 RTF1 text fragment subset; no general Word compatibility.
- Complete bounded lexical pass precedes supported interpretation; unknown visible controls are unsupported422. Resource cap413 terminates before excess retention, malformed structure400 overrides earlier excluded422 only within capped traversal.
- Groupdepth16, totalgroups256, paragraphslots128 include omitted groups and empty slots. Scoped b/i/uc0..2; BMP non-surrogate/private-use exclusions; Unicode fallback counts complete tokens without semantics.
- Literal Markdown punctuation is escaped, HTML&<> encoded, hardbreaks protected; only ASCIIspace/TAB trim/normalize. NBSP and other permitted BMP spaces remain. Omitted destinations and fixed warnings deduplicate in first encounter order.
- Both tools validate identical MarkdownUTF8<=16384 and compact serialized Markdown-envelopeUTF8<=32768; own complete outputUTF8<=32768. Exact generic AppError ABI; absent details, no reflected input payload.
- No network, filesystem, external loads, macros, ZIP/PDF engines, surrogate repair or layout fidelity; real WorkerCPU/preemptive memory and privacy integration remain separate qualification gates.
- Visible hex-decoded CP1252 C0/DEL characters are unsupported_input; valid fallback or omitted hex controls are discarded. Raw CR/LF/TAB exceptions and structural validation stay unchanged.

## Input

- `bytes_base64` (string, required): min length 4; max length 10924

## Output

- `format` (constant "rtf", required)
- `rtf_version` (constant 1, required)
- `ansi_code_page` (constant 1252, required)
- `destinations_skipped` (array of string, required): max items 256; each pattern `^[A-Za-z]{1,32}$`
- `pictures` (integer, required): min 0; max 256
- `objects` (integer, required): min 0; max 256
- `paragraphs` (integer, required): min 0; max 128
- `warnings` (array of one of "metadata_destinations_omitted", "pictures_omitted", "objects_omitted", "starred_destinations_omitted", "tabs_normalized", required): max items 5

## Limits

- max base64 chars: 10924
- max decoded bytes: 8192
- max group depth: 16
- max groups: 256
- max paragraph slots: 128
- max control word letters: 32
- max numeric digits: 10
- max retained text utf8 bytes: 16384
- max markdown utf8 bytes: 16384
- max shared markdown json utf8 bytes: 32768
- max output utf8 bytes: 32768

## Example

Request input:

```json
{
  "bytes_base64": "e1xydGYxXGFuc2kgSGVsbG9ccGFyIFdvcmxkfQ=="
}
```

Response:

```json
{
  "result": {
    "format": "rtf",
    "rtf_version": 1,
    "ansi_code_page": 1252,
    "destinations_skipped": [],
    "pictures": 0,
    "objects": 0,
    "paragraphs": 2,
    "warnings": []
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "rtf-inspect",
  "version": "1.0.0",
  "input": {
    "bytes_base64": "e1xydGYxXGFuc2kgSGVsbG9ccGFyIFdvcmxkfQ=="
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/rtf-inspect/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"bytes_base64":"e1xydGYxXGFuc2kgSGVsbG9ccGFyIFdvcmxkfQ=="}'
```

The machine-readable contract is at [/v1/tools/rtf-inspect/versions/1.0.0](/v1/tools/rtf-inspect/versions/1.0.0).

### CLI

```sh
node cli.mjs run rtf-inspect 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Rtf to markdown](/tools/rtf-to-markdown): Convert an 8 KiB ANSI-1252 RTF text subset to escaped Markdown; unsupported Word features are refused.
- [Xlsx inspect](/tools/xlsx-inspect): inspect excel workbook structure.
- [Xlsx to CSV](/tools/xlsx-to-csv): convert excel sheet to csv.
- [Xlsx to markdown](/tools/xlsx-to-markdown): convert excel workbook to markdown.
