Skip to content

Trim oversized REST operation exports — 10 pages are 42% of the reference corpus #607

Description

@hey-august

#564 asked whether endpoint exports carry bloat that crowds out the answer. They do, but not the navigation tree that issue described. Verified against the deployed exports on 2026-08-18.

Every operation ships eight SDK snippets — python, javascript, go, ruby, java, php, csharp, swift — regardless of relevance. On a small page that is most of the bytes: get-conference-token is 4,736 bytes, of which 3,262 are fenced code (68%); update-account is 9,360 bytes, 5,410 fenced (57%). A model answering a question about one operation in one language pays for eight.

Ten pages are 42% of the entire 4.7 MB reference corpus, against a median page of 7,156 bytes:

Page Bytes
apis/rest/ai-agents/ai-agents-custom/create-ai-agent 347,574
apis/rest/ai-agents/ai-agents-custom/update-ai-agent 345,111
apis/rest/calls/call-commands 330,972
apis/rest/ai-agents/ai-agents-custom/get-ai-agent 172,224
apis/rest/call-flows/update-call-flow 148,693
apis/rest/call-flows/create-call-flow 146,776
apis/rest/ai-agents/ai-agents-custom/list-ai-agents 143,391
apis/rest/resources/list-resources 109,413
apis/rest/resources/get-resource 108,520
apis/rest/call-flows/deploy-call-flow-version 106,256

Two distinct causes, and they want different fixes:

  • create-ai-agent is 347 KB of which only 19 KB is code. The rest is 2,312 parameter bullets nested seven levels deep, the whole AI agent configuration surface inlined into one flat list. A deeply nested object graph rendered as flat prose is close to unusable for retrieval; this wants the nested schema split into addressable component pages that the operation links to.
  • call-commands is 42 distinct commands on one page, each with its own eight snippets. This is the one place where Standardize endpoint .md exports: no global nav tree, stable per-operation structure #564's "each endpoint independently retrievable" framing lands: an agent that wants calling.transfer must ingest all 42. This wants per-command pages, or at minimum per-command anchors that the section-level llms.txt exposes.

Both are worth confirming against Fern before scoping — whether the language set is configurable, and whether nested schemas can render as references rather than inline expansion, may both be upstream questions like #525.

Not one of #564's checklist items; filed because #564 was closed on a premise that did not hold and this is the retrieval cost that is actually there. Audit §8.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions