A paid endpoint answers with an array of 50 NFTs and a field nftCount: 50. The wallet it was asked about has more. Nothing else in the response says so โ no flag, no cursor, no "showing 50 of N". The buyer, usually an agent, budgeted one call, got a number that looks like an answer, and moved on with a conclusion built on part of the data.
That is not a wrong answer. A wrong answer gets caught: the value fails a schema check, contradicts another field, or crashes the caller. This one passes every check the caller can run, because it is exactly the shape of a correct answer. It is only smaller.
On 2026-11-27 we swept our own catalogue for it โ 96 output-side slice(0, N) sites and 94 count: something.length sites across the deployed handlers โ and found nine live endpoints doing it. This is what the family looks like, why per-endpoint smoke tests never catch it, and the disclosure shape that makes it impossible.
const items = (data.items || []).slice(0, 50); // cap the payload
return { ok: true, nftCount: items.length, nfts: items };
// ^^^^^^^^^^^^ counts the slice
nftCount is a promise about the wallet; items.length is a fact about the array. After the slice those are different numbers, and the field is named for the one it is not. The buyer reads how many NFTs this wallet has and is told how many we decided to send.
Two smaller variants of the same lie turned up in the same sweep. One returns a count from upstream but truncates the body with no marker at all: the page text stops at 50,000 characters and the response has no field that distinguishes "this page is 50,000 characters" from "this page is longer and you are reading a prefix". The other cuts a banner to 500 characters and calls it the banner.
Compare it with a nearer-miss failure we fixed earlier the same day: an endpoint returned contentLength: 120000 next to an html string that had been trimmed. That is at least self-comparable โ a careful caller can check html.length against contentLength and see the gap.
nftCount: 50 gives the caller nothing to compare against. There is no second number. The only way to learn that another page exists is to call a different API (the upstream explorer) and read its pagination token โ which is not something a caller paying for your abstraction should have to do.
Smoke tests do not catch it either. A test wallet with 50 NFTs returns 50 of 50: correct. The defect only exists for wallets past the cap, and the bigger the wallet, the more wrong the answer โ which is exactly backwards from how damage should scale.
What we now emit, on all nine:
{
"ok": true,
"nftCount": 312, // from the upstream answer, not from the array
"returnedNfts": 50, // what is actually in `nfts`
"nftsTruncated": true, // the cap was hit
"hasMore": true, // the upstream says another page exists
"nfts": [ /* 50 items */ ]
}
Four fields, and each answers a question the buyer would otherwise have to guess at:
nftCount โ how many exist (taken from upstream, never from the sliced array);returnedNfts โ how many you got;nftsTruncated โ whether the two differ because of our cap;hasMore โ whether the upstream itself has another page (only when the upstream exposes pagination; a bare "there's more" without a way to get it is a taunt, not a disclosure).For string bodies the pair is returnedHtmlChars and htmlTruncated, plus a switch (raw: false) for callers who wanted the structure and not the body in the first place. Live check after the change: a wallet whose upstream answer carried a non-empty next_page_params now reports hasMore: true; a JSON object with 120 keys reports keysTruncated: true with keys capped at 50.
The same sweep turned up a sibling that is worse in one way. One endpoint fetched /robots.txt and, when the host answered 404 with an HTML error page, returned that HTML as the robots body. A caller parsing it as robots directives sees markup it cannot parse โ or, worse, extracts the wrong rule from a page that happens to contain the word Disallow.
The fix is the same discipline applied to the status code: only a 2xx body is content. A 404 is an answer โ "this host has no robots.txt" โ and it is expressible:
{ "ok": true, "present": false, "robots": null, "status": 404 }
present: false is a fact about the host. robots: "<html>โฆ" was a fact about the error page dressed up as the first.
.length on anything that was assigned from a slice in the same function. That pair is the bug.false in your tests, the test data is too small, not the code too good.None of this is exotic. It is the difference between an API whose answers a program can reason about and one whose answers merely look plausible โ and for an agent buying calls it has no way to audit, plausible is the dangerous kind.
The marketplace is at minia2a.uk โ 1,958 pay-per-call endpoints in USDC on Base, 5 free trial calls per signed wallet on the endpoints that offer trials, no registration. The nine endpoints in this post now carry the disclosure fields above; if you call one and the caps bite, the response will tell you so.
โ All posts