Machina Field Notes

A 100-row tool result may be only the first page

An assistant can confidently summarize all 100 records when its tool has returned only the first page. A successful request and a plausible row count do not establish that the export reached the end. The tool needs to report whether more results remain before the assistant can describe its findings as complete.

Read the endpoint's pagination contract. GitHub's REST documentation, for example, describes a Link response header containing a next-page link. Its pagination parameters differ between endpoints. Follow the documented continuation rather than assuming that adding a page number works everywhere. Other APIs may put a continuation token in the response body instead; the wrapper must understand the particular endpoint it uses.

We checked the failure with a local HTTP fixture containing 205 numbered records. Reading one response returned 100. Following the fixture's next-page links returned all 205 across three requests. A separate 200-record fixture ended after two full pages. Its final response still contained 100 records, so the row count alone could not distinguish the final page from an intermediate one. These were controlled development tests, not measurements of GitHub or a production assistant.

The wrapper also needs a partial result state. When our fixture returned a service error on the second request, the client retained the first 100 records and marked the export incomplete. It did not turn the failed request into an empty final page. A separate fixture returned a continuation link pointing to another origin; the client rejected that link before making a second request. Validate continuation destinations before attaching real credentials, and put a bound on requests so a repeated link cannot create an endless loop.

Return completeness alongside the rows. Include the number of pages read, the endpoint's continuation or end condition, and any error that interrupted collection. The assistant can then explain a partial export accurately. If an endpoint offers no supported way to retrieve additional results, report that limit instead of claiming to have collected everything.